aspose file tools*
The moose likes Object Relational Mapping and the fly likes Need help to correct @JoinColumn mapping in entity class with composite keys Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Need help to correct @JoinColumn mapping in entity class with composite keys" Watch "Need help to correct @JoinColumn mapping in entity class with composite keys" New topic
Author

Need help to correct @JoinColumn mapping in entity class with composite keys

Jack Bush
Ranch Hand

Joined: Oct 20, 2006
Posts: 235
Hi All,

I am no longer able to deploy the Customer (OneToMany Unidirectional) entity class/bean after having setup composite primary key (@IdClass) as follows:


Below is the application client output:

Deploying application in domain failed; Deployment ErrorException [TOPLINK-28018] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.EntityManagerSetupException
Exception Description: predeploy for PersistenceUnit [TravelAgentDB-PU] failed.
Internal Exception: Exception [TOPLINK-7220] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.ValidationException
Exception Description: The @JoinColumns on the annotated element [private java.util.Collection domain.Customer.hobbies] from the entity class [class domain.Customer] is incomplete. When the source entity class uses a composite primary key, a @JoinColumn must be specified for each join column using the @JoinColumns. Both the name and the referenceColumnName elements must be specified in each such @JoinColumn. -- Exception [TOPLINK-28018] (Oracle TopLink Essentials - 2.1 (Build b60e-fcs (12/23/2008))): oracle.toplink.essentials.exceptions.EntityManagerSetupException

I am running JDK 1.6.0_12, Glassfish v2.1 and Netbeans 6.5.1 on Windows XP platform.

I would appreciate if anyone could assist with completing the @JoinColumn and referenceColumnName since I am little baffled with JPA schema mapping still.

This question was posted at http://forums.sun.com/thread.jspa?threadID=5398528&tstart=0 but have not received any feedback so far.

Thanks in advance,

Jack
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help to correct @JoinColumn mapping in entity class with composite keys