Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » (no subject)
(no subject) [message #713824] Tue, 09 August 2011 06:31 Go to next message
darren is currently offline darrenFriend
Messages: 15
Registered: July 2009
Junior Member
I tried the Java SE case without a constructor expression but with TYPE(e) and get the same error:

public List findAllEmployeeProjectionObjects() {
return em.createQuery(
"SELECT TYPE(e),, "+
"FROM Employee e "+

Persisted examples.model.Employee[ id=158 ]
Found examples.model.Employee[ id=158 ]
Found employee: examples.model.Employee[ id=158 ]
Found employee DTO: EmployeeDTO[ id=158 ] [ name=John Doe] [ entityName=null] [ entityClass=null]
Exception in thread "main" Local Exception Stack:
Exception [EclipseLink-6093] (Eclipse Persistence Services - 2.2.0.v20110202-r8913): org.eclipse.persistence.exceptions.QueryException
Exception Description: Invalid Type Expression on [examples.model.Employee]. The class does not have a descriptor, or a descriptor that does not use inheritance or uses a ClassExctractor for inheritance
at org.eclipse.persistence.exceptions.QueryException.invalidTypeExpression(
at org.eclipse.persistence.internal.expressions.ClassTypeExpression.validateNode(
at org.eclipse.persistence.expressions.Expression.normalize(
at org.eclipse.persistence.internal.expressions.DataExpression.normalize(
at org.eclipse.persistence.internal.expressions.SQLSelectStatement.normalize(
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.buildReportQuerySelectStatement(
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.buildReportQuerySelectStatement(
at org.eclipse.persistence.internal.queries.ExpressionQueryMechanism.prepareReportQuerySelectAllRows(
at org.eclipse.persistence.queries.ReportQuery.prepareSelectAllRows(
at org.eclipse.persistence.queries.ReadAllQuery.prepare(
at org.eclipse.persistence.queries.ReportQuery.prepare(
at org.eclipse.persistence.queries.DatabaseQuery.checkPrepare(
at org.eclipse.persistence.queries.ObjectLevelReadQuery.checkPrepare(
at org.eclipse.persistence.queries.DatabaseQuery.prepareCall(
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.buildEJBQLDatabaseQuery(
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(
at org.eclipse.persistence.internal.jpa.EJBQueryImpl.<init>(
at org.eclipse.persistence.internal.jpa.EntityManagerImpl.createQuery(
at examples.application.EmployeeService.findAllEmployeeProjectionObjects(
at examples.application.EmployeeTest.main(
Java Result: 1
Re: (no subject) [message #713827 is a reply to message #713824] Tue, 09 August 2011 06:47 Go to previous messageGo to next message
darren is currently offline darrenFriend
Messages: 19
Registered: March 2011
Location: Sydney, Australia
Junior Member
I don't know why this has spawned a new thread, it was submitted and accepted as a reply message:
Re: (no subject) [message #715751 is a reply to message #713824] Mon, 15 August 2011 12:07 Go to previous message
Gordon Yorke is currently offline Gordon YorkeFriend
Messages: 78
Registered: July 2009
The exception states that your Employee Entity does not have an assigned Discriminator Value and is not part of a mapped Inheritance Hierarchy. As the spec requires TYPE to return the type discriminator if there is no Discriminator Value provided in the mappings then none can be returned by the TYPE operator. TYPE only works with mapped Inheritance.
Previous Topic:TYPE() fails in projection query result: EclipseLink ConversionException
Next Topic:Sometimes, unknown entity type, !? [Solved]
Goto Forum:

Current Time: Sat Apr 17 16:10:30 GMT 2021

Powered by FUDForum. Page generated in 0.01591 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top