Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Get exception when calling getIdClassAttributes in child class
Get exception when calling getIdClassAttributes in child class [message #637144] Thu, 04 November 2010 11:15 Go to next message
Weber Chu is currently offline Weber ChuFriend
Messages: 14
Registered: October 2010
Junior Member
I have a MappedSuperClass which contains the @IdClass attribute because and the children are sharing the same primary key object.
@MappedSuperclass
@IdClass(PK.class)
public abstract class ParentClass implements Serializable {
    ....
}

And the child entity simply extends the parent
@Entity
@Table(name="MyTable")
public class ChildClass extends ParentClass

When I call the getIdClassAttributes() method from the EntityType of ChildClass. I get an IllegalArgumentException.
Caused by: java.lang.IllegalArgumentException: No @IdClass attributes exist on the IdentifiableType [EntityTypeImpl@28384121:ChildClass [ javaType: class ChildClass descriptor: RelationalDescriptor(ChildClass --> [DatabaseTable(MyTable)]), mappings: 22]].  There still may be one or more @Id or an @EmbeddedId on type.


My current workaround is to add the @IdClass(PK.class) annotation to ChildClass...

Is my setting incorrect or is it a bug? Thanks.
Re: Get exception when calling getIdClassAttributes in child class [message #637204 is a reply to message #637144] Thu, 04 November 2010 15:01 Go to previous messageGo to next message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Sounds like a bug, please log a bug and vote for it.

It the issue with the metamodel your only issue? Does the class work at runtime (persist, find, etc.).



James : Wiki : Book : Blog : Twitter
Re: Get exception when calling getIdClassAttributes in child class [message #637318 is a reply to message #637204] Fri, 05 November 2010 02:12 Go to previous message
Weber Chu is currently offline Weber ChuFriend
Messages: 14
Registered: October 2010
Junior Member
It is the only issue I have encountered using the metamodel so far.

And I have submitted to bugzilla for this issue.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=329508
Previous Topic:Postgis Eclipselink JPA
Next Topic:HSQLDB 2 and Internal Exception: Error Code -5501
Goto Forum:
  


Current Time: Thu Apr 25 10:14:14 GMT 2024

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

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

Back to the top