2 Replies Latest reply on Oct 26, 2009 3:00 PM by Martin Wilmes

    Problem Joining 3 Tables

    Martin Wilmes Newbie


      I have two Entities A and B each with a simple primary key idA and idB. I join them using a third table AB that has a composite primary key using an embedded primary key class ABPk. So far it works fine.

      Now I got another table C with a simple primary key idC involved that has to be joined with AB using another table ABC. So this last table has a composite primary key ABCpk that consists of the parts idC and ABPk which itself consists of idA and idB.

      All composite primary keys use the @Embeddable Annotation and are imbedded using @EmbeddedId similar to what is recommended in https://www.jboss.org/community/wiki/EJB3relationships

      My problem is that on ABC I can't activate the @ManyToOne Annotation that references AB. On deployment this gives me a NullPointerException.

      I am using JBoss 4.2.3.GA with Sun Java