-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate Annotation with composite primary key
PostPosted: Thu Jun 30, 2005 2:34 am 
Newbie

Joined: Tue Jun 14, 2005 2:04 am
Posts: 2
Hibernate version:
3.0.3

I try to define a composite primary key with annotation.But it seem not to support yet.

@Entity
public class MyClass{

@Id
public CompositeKey getCKey()...
}

@Embeddable
public class CompositeKey{

@EmbeddedId
public String getProp1()

@EmbeddedId
public String getProp2()
}

The Exception is:

java.lang.UnsupportedOperationException
at org.hibernate.util.EmptyIterator.next(EmptyIterator.java:18)
at org.hibernate.util.JoinedIterator.next(JoinedIterator.java:53)
at org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1099)
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:715)
at org.hibernate.cfg.AnnotationBinder.processElementsOfAClass(AnnotationBinder.java:587)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:458)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:177)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:999)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.