-->
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: must not have @Id properties when used as an @EmbeddedId
PostPosted: Wed Jan 14, 2009 2:39 pm 
Newbie

Joined: Sun Oct 26, 2008 8:46 am
Posts: 1
Hi I experience strange error: IdClass must not have @Id properties when used as an @EmbeddedId


Let's consider following code
Code:
@MappedSuperclass
public class SuperClass {
  @EmbeddedId
  public IdClass complexId;
}

@Entity
public class Class1 extends SuperClass {
   public String someString;
}

@Embeddable
public class IdClass {
  public int id1;
public int id2;
}



during binding I get exception:

IdClass must not have @Id properties when used as an @EmbeddedId
at org.hibernate.cfg.AnnotationBinder.bindId(AnnotationBinder.java:1879)
at org.hibernate.cfg.AnnotationBinder.processElementAnnotations(AnnotationBinder.java:1279)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:754)
at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:546)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:291)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1319)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)

anybody has idea what's wrong? (of course in example code there are getters and setters)
I use version 3.4.0 of hibernate annotations lib.


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.