Error Message An Alias Is Required For The Schema Name
Phillip 6:25 PM on 06/16/2013 Tags: development ( 12 ), java ( 27 ), maven ( 9 ), OpenJPA, oqt, plugin ( 2 ), programming ( 15 ), project ( 14 ) oqt-maven-plugin v0.3 release Today I've release the oqt-maven-plugin v0.3 to the Sonatype OSS. Not much has changed since v0.2, I've just fixed 2 bugs and made very few other improvements. All info can be found on http://oqt.sourceforge.net/ . In earlier versions I've stated that you could add the plugin to the module containing the entities but this is in fact not working; for some reason the freshly compiled classes in the target won't find their way to the classpath. I'm still thinking about a solution for this, but for the moment it's best to put the oqt-maven-plugin in your EJB-JAR. Phillip 11:37 AM on 12/31/2011 Tags: J2EE ( 4 ), java ( 27 ), JPA ( 3 ), OpenJPA An alias is required for the schema name MyEntity in theexpression. Yesterday I came across the following error message while testing a JPQL named query An alias is required for the schema name MyEntity in the expression… A quick Yahoo! search only returned me something like this which isn't very useful. Anyway, the solution was extremely simple: my name query was incorrect. Instead of writing select ent from MyEntity ent where ent.status.code = : code I had written select ent from MyEntity where ent.status.code = :code Because I had forgotten to declare the variable ‘ent' I suppose OpenJPA expected it to be a schema name or something. Phillip Belgian Java EE developer, technology enthusiast and digital photographer urbex'er. View Full Profile → Latest J-ExifTool version v0.0.9 Coins Donations always welcome BTC: 1P8EgighsZo7urYd17M4Q3NpbWoiQ1GHER LTC: LhodTGPae3XT6CtuKrKcmDEp42EesE1rKH Alt.Coins See here TweetsMy Tweets Create a free website or blog at WordPress.com. P_W999 Create a free website or blog at WordPress.com. Post to Cancel
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up How do you set the schema name for sequences at deploy time when using JPA? up vote 4 down https://pw999.wordpress.com/tag/openjpa/ vote favorite 1 For security reasons, our oracle db objects normally belong to a different schema than the logged in user. Eg. tables are in xx_core and the user we log in is xx_app_yy . In my persistence.xml I define a orm file so that I can specify the schema name at deploy time eg.:
[blame]# Licensed to the Apache Software Foundation (ASF) under one# or more contributor license agreements. See the NOTICE file# distributed with this work for additional information# regarding copyright ownership. https://apache.googlesource.com/openjpa/+/e966f0f51c8c00bbaddbae9398e2952643e9af09/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/jpql/localizer.properties The ASF licenses this file# to you under the Apache License, Version 2.0 (the# "License"); you may not use this file except in compliance# with the License. You may obtain a copy of the License at## http://www.apache.org/licenses/LICENSE-2.0## Unless required by applicable law or agreed to in writing,# software distributed under the License is distributed on an# "AS IS" BASIS, error message WITHOUT WARRANTIES OR CONDITIONS OF ANY# KIND, either express or implied. See the License for the# specific language governing permissions and limitations# under the License. param-decs-invalid: JPQL does not support declared parameters.bad-jpql: The JPQL string "{0}" is not valid. \ Make sure all parentheses are matched and that you use proper JPQL syntax.bad-tree: The JPQL statement is not valid: encountered error message an a node of type \ "{0}".parse-error: An error occurred while parsing the query filter ''{1}''. \ Error message: {0}no-alias: The alias "{0}" was not declared in the statement (declared \ aliases are: {1}). All aliases must be declared in the "from" \ section of the JPQL statement.cant-resolve-type: The entity "{0}" cannot be resolved; please ensure that \ the entity name has been declared for the class.not-identifer: The specified node ("{0}") is not a valid identifier.no-field: No field named "{0}" in "{1}". Did you mean "{2}"? Expected one of \ the available field names in "{3}": "{4}".multi-valued-travesal: Attempt to navigate to relation field "{0}" via multi-valued \ association "{1}". JPQL does not allow traversal through multi-valued \ relation path. Try join instead. unaccessible-field: The field named "{1}" in class "{0}" could not be accessed.multi-children: Expression "{0}" does not allow multiple children ("{1}").no-children: Expression "{0}" requires at least one child.unknown-comp: Unknown comparison operator "{0}".wrong-child-count: Wrong number of arguments to expression \ of type "{1}": should have been {0}, but the following arguments \ were specified: "{2}".less-child-count: Insufficient number