EclipseLink issue in WLS 12c JPQL query compilation issue: can't be resolved to a valid type [message #1708760] |
Sun, 20 September 2015 15:04  |
Eclipse User |
|
|
|
Hello,
We migrate some of our solution from 10.3.6 (EclipseLink 2.3.1) to 12.1.3 (EclipseLink 2.5.2) and we got an issue:
an exception occurred while executing method
javax.persistence.PersistenceException: Exception [EclipseLink-28013] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Unable to deploy PersistenceUnit [XXX] in invalid state [DeployFailed].
Internal Exception: javax.persistence.PersistenceException: Exception [EclipseLink-28019] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.EntityManagerSetupException
Exception Description: Deployment of PersistenceUnit [XXX] failed. Close all factories for this PersistenceUnit.
Internal Exception: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.5.2.v20140319-9ad6abd): org.eclipse.persistence.exceptions.JPQLException
Exception Description: Problem compiling ... (A select with an order by myentity.id at the end)
[224, 236] The state field path 'myentity.id;' cannot be resolved to a valid type.
The field id in my entity is declared like this:
@Id
@SequenceGenerator(name = "mySequence", sequenceName = "SEQ_ID", initialValue = 1, allocationSize = 50)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "mySequence")
@Column(name = "N_ID")
protected Long id;
So what's going wrong between these 2 EclipseLink versions ? a regression because I haven't this issue with WLS 10.3.6 (eg EclipseLink 2.3.1) ?
Best Regards.
|
|
|
|
Re: EclipseLink issue in WLS 12c JPQL query compilation issue: can't be resolved to a valid type [message #1708799 is a reply to message #1708794] |
Mon, 21 September 2015 10:47   |
Eclipse User |
|
|
|
Hello,
For sure I can:
Annotation at class level:
@Entity
@Table(name = "MY_ENTITY")
@NamedQueries({
@NamedQuery(name = XXX, query = "SELECT myentity "
+ "FROM MyEntity AS myentity WHERE ...."),
....
@NamedQuery(name = YYY, query = "SELECT myentity "
+ "FROM MyEntity AS myentity WHERE ....") })
@NamedNativeQuery(name = "ZZZ", query = "SELECT SEQ_XXX_ID.NEXTVAL FROM DUAL")
public class MyEntity implements Serializable {
...
}
The issue of the named query is located before the last NamedQuery in the NamedQueries list. You have to know that I have other NamedQuery where the clause myentity.id in ORDER_BY is at the end.
<persistence-unit name="XXXPU"
transaction-type="JTA">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>
<jta-data-source>mycompagny_xa_failover.ds</jta-data-source>
<class>com.mycompagny.sss.ttt.model.MyEntity</class>
<properties>
<!-- No schema generation -->
<property name="eclipselink.ddl-generation" value="NONE" />
<property name="eclipselink.orm.validate.schema" value="true" />
<!-- Target -->
<property name="eclipselink.target-server" value="WebLogic_10" />
<property name="eclipselink.target-database" value="Oracle10g" />
<!-- logging option -->
<property name="eclipselink.logging.level" value="WARNING" />
<property name="eclipselink.logging.timestamp" value="true" />
<property name="eclipselink.logging.session" value="true" />
<property name="eclipselink.logging.thread" value="true" />
<property name="eclipselink.logging.exceptions" value="true" />
<property name="eclipselink.logging.logger" value="ServerLogger" />
<property name="eclipselink.logging.file" value="eclipselink.log" />
<property name="eclipselink.orm.throw.exceptions" value="true" />
<!-- Optimization -->
<property name="eclipselink.jdbc.native-sql" value="true" />
<property name="eclipselink.jdbc.batch-writing" value="JDBC" />
<property name="eclipselink.jdbc.fetch-size" value="25" />
<!-- <property name="eclipselink.profiler" value="PerformanceProfiler" /> -->
<!-- Cache -->
<property name="eclipselink.cache.shared.default" value="true" />
<property name="eclipselink.cache.shared.MyEntity" value="false" />
</properties>
</persistence-unit>
Best Regards.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04133 seconds