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.