Community
Participate
Working Groups
Build Identifier: 2.0.1.v20100213-r6600 While testing out EclipseLink criteria API, I'm getting an error java.lang.IllegalArgumentException: The type [null] is not the expected [ManagedType] for the key class [EntityBase] when calling EntityManager.getCriteriaBuilder(). I seem to get the error only if any of the project's entities extend a non-entity. Without such entities the criteria query works, but if I add to the project something like: @Entity public class TestEntity extends EntityBase { @Id @GeneratedValue(strategy = GenerationType.TABLE) private Long id; public void setId(Long id){ this.id=id; } public Long getId() { return id; } } public class EntityBase { } .. the criteria query again fails at calling getCriteriaBuilder(): -- clip -- java.lang.IllegalArgumentException: The type [null] is not the expected [ManagedType] for the key class [EntityBase]. at org.eclipse.persistence.internal.jpa.metamodel.MetamodelImpl .managedType(MetamodelImpl.java:424) at org.eclipse.persistence.internal.jpa.metamodel.ManagedTypeIm pl.getManagedSuperType(ManagedTypeImpl.java:755) at org.eclipse.persistence.internal.jpa.metamodel.ManagedTypeIm pl.isAttributeDeclaredOnlyInLeafType(ManagedTypeImpl.java:10 51) at org.eclipse.persistence.internal.jpa.metamodel.ManagedTypeIm pl.isAttributeDeclaredOnlyInLeafType(ManagedTypeImpl.java:99 9) at org.eclipse.persistence.internal.jpa.metamodel.ManagedTypeIm pl.getDeclaredAttributes(ManagedTypeImpl.java:314) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. initializeCanonicalMetamodel(EntityManagerSetupImpl.java:198 0) at org.eclipse.persistence.internal.jpa.EntityManagerSetupImpl. getMetamodel(EntityManagerSetupImpl.java:1958) at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp l.getMetamodel(EntityManagerFactoryImpl.java:472) at org.eclipse.persistence.internal.jpa.EntityManagerFactoryImp l.getCriteriaBuilder(EntityManagerFactoryImpl.java:456) at org.eclipse.persistence.internal.jpa.EntityManagerImpl.getCr iteriaBuilder(EntityManagerImpl.java:2081) -- clip -- I'm using EclipseLink 2.0.1, Spring 2.5.6, Tomcat 6, PostgreSQL 8.4. Reproducible: Always Steps to Reproduce: 1. Make one of project's @Entity annotated classes extend an empty class without any JPA annotations 2. Make a call to EntityManager.getCriteriaBuilder()
Setting target and priority. See the following page for a description of the meanings of these values: http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
This is duplicate to report https://bugs.eclipse.org/bugs/show_bug.cgi?id=302606 filed 2010-02-11 12:19 *** This bug has been marked as a duplicate of bug 302606 ***
>This Transient root of an Entity issue was fixed in SVN rev# 7444 (2 June 2010 in EclipseLink 2.1) for bug# 315287 http://fisheye2.atlassian.com/changelog/eclipselink/?cs=7444 >I forgot that I fixed this 50 days ago (if you still experience the issue - we can reopen the bug) Fix: We were not returning correctly when the superType of a ManagedType was a BasicType (Transient) >This was design issue 103 for enhancement bug# 266912 http://wiki.eclipse.org/EclipseLink/Development/JPA_2.0/metamodel_api#DI_103:_20100601:_315287:_Handle_BasicType_as_inheritance_root_for_ManagedTypes
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink