Is it possible to have a CMR field that maintains a relationship and also has a CMP field accessor. I'd like to use CMR on fields that are both a primary and foreign key.
Thanks all.
-
Using CMR with combined primary and foreign keys (1 messages)
- Posted by: mark greene
- Posted on: September 11 2003 23:38 EDT
Threaded Messages (1)
- Using CMR with combined primary and foreign keys by Paul Strack on September 12 2003 10:45 EDT
-
Using CMR with combined primary and foreign keys[ Go to top ]
- Posted by: Paul Strack
- Posted on: September 12 2003 10:45 EDT
- in response to mark greene
What you want to do is possible. You need two separate abstract fields, though: one for your CMP and one for your CMR:
public abstract Long get/setFK();
public abstract RelatedBean get/setRelatedBean();
When you map the CMP EJB to the database, be sure to map the abstract FK field to the correct foreign key that maintains the relationship.