Hey all,
3 days later....time to ask the list :P

I have an existing 1:N table relationship between table Case and Schedule. Now, the pk 
for Case is 'caseId' and for Schedule it is 'caseId_scheduleIncrement' (created from 
two other fields 'caseId_fk' and 'scheduleIncrement', old process that must be 
maintained). You can guess that Case.caseId maps to Schedule.caseId_fk for the 1:N 
relationship. These two tables are already populated with data, and I would like to 
setup CMR without interruption/change to the process and THEN, hopefully, be able to 
call Case.getSchedules() and return a collection/set of all schedules for that case 
from a Session Bean.

I have had most every error related to CMR, including the "both roles of a 
relationship...must have key fields" and something like CMR can not be used outside of 
creation transaction(deploys correctly, but can not use method).  For Schedule, I have 
been using ejbcreate to populate the 'caseId_fk', 'scheduleIncrement', and 
'caseId_scheduleIncrement' field programattically - this works without CMR, but now 
trying to get these to EJB's to work with CMR.

Jboss 3.2.2RC2, Xdoclet 1.2b4

Attempt so far:
/*****************
 *CMR Relational Methods (Schedule EJB)
 *****************/
/**
 * @ejb.interface-method
 *   view-type="local"
 *
 * @ejb.relation
 *      name="Case-Schedules"
 *      role-name="many-schedules-has-one-case"
 *
 * @jboss:relation
 *      fk-constraint="false"
 *      related-pk-field="caseId_fk"
 *      fk-column="caseId"
 * @weblogic.column-map
 *   key-column="caseId"
 *   foreign-key-column="caseId_fk"
 */
public abstract CaseLocal getCase();



/*****************
 *CMR Relational Methods (Case EJB)
 *****************/
/**
 * @ejb.interface-method
 *   view-type="local"
 *
 * @ejb.relation
 *      name="Case-Schedules"
 *      role-name="one-case-has-many-schedules"
 *
 * @weblogic.column-map
 *   key-column="caseId_fk"
 *   foreign-key-column="caseId"
 */
public abstract java.util.Set getSchedules();


Any help would be great, I want to do this as 'correct' as possible with least 
workarounds (<workarounds=<hairpulling=>timedoingotherstuff)
TIA!
-D


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to