Hello All, I am implementing an Entity class as below
@Entity@Table(name=*"Employee"*)@IdClass(EmployeeEntityPK.*class*)*public class *EmployeeEntity *extends *AbstractEntity { //with no attributes only getter / setter My AbstractEntity is a @MappedSuperClass with one @Id,@Column and other @Columns defined Also I have EmployeeEntityPK which has @Id@Column(name = *"empId"*)*private *Integer *empId*; When I deploy my application I get exception as Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0 at java.util.ArrayList.RangeCheck(ArrayList.java:547) [rt.jar:1.6.0_17] at java.util.ArrayList.get(ArrayList.java:322) [rt.jar:1.6.0_17] at org.hibernate.cfg.AnnotationBinder.getUniqueIdPropertyFromBaseClass(AnnotationBinder.java:2576) at org.hibernate.cfg.AnnotationBinder.isIdClassPkOfTheAssociatedEntity(AnnotationBinder.java:925) at org.hibernate.cfg.AnnotationBinder.mapAsIdClass(AnnotationBinder.java:824) at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:671) AnnotationBinder.getUniqueIdPropertyFromBaseClass has a check as follows *if *( elementsToProcess.getIdPropertyCount() == 1 ) { which checks if my Entity has only one ID attribute, if so then getsUniqueId from base class. In my case I dont have any ID attribute in my EmployeeEntity so the I get ArrayIndexOutOfBoundException. Ideally in getUniqueIdPropertyFromBaseClass, baseClassElements should be processed from AbstractEntity. Why its processing elements from EmployeeEntity? Is this expected behaviour I have added my source code to https://github.com/surendrand/hibernate-entity-mapping for further reference _______________________________________________ hibernate-dev mailing list hibernate-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/hibernate-dev