Yes, exactly. Non-null CMP fields, that share with FK fields columns in the table, should be set in ejbCreate.
You can check org.jboss.test.cmp2.fkmapping.* for all the scenarios and mappings. alex Monday, March 24, 2003, 6:55:25 PM, Jonathan O'Connor wrote: JOCxd> Alex, JOCxd> Presumably, in ejbCreate() I have to call setFkAsCmpField(fkObj.getKey()), JOCxd> and then I don't need to call setFkAsCmrField( fkObj ) in ejbPostCreate(). JOCxd> Ciao, JOCxd> Jonathan O'Connor JOCxd> Development Manager JOCxd> XCOM Dublin JOCxd> Phone: +353 1 872 3305 JOCxd> Mobile: +353 86 824 0736 JOCxd> Alex Loubyansky <[EMAIL PROTECTED]> JOCxd> Sent by: [EMAIL PROTECTED] JOCxd> 24.03.2003 15:52 JOCxd> Please respond to jboss-user JOCxd> To: Simone Milani <[EMAIL PROTECTED]> JOCxd> cc: JOCxd> Subject: Re[4]: [JBoss-user] CMR with FK in the database JOCxd> Hello Simone, JOCxd> actually, it looks like exposing FK field[s] as non-null CMP field[s]. JOCxd> Just map FK fields to CMP fields in jbosscmp-jdbc.xml. JOCxd> NOTE: there is currently a bug (stack overflow on loading) in FK fields JOCxd> map to CMP columns. JOCxd> I can't commit changes to CVS the whole day. I hope Dain will help JOCxd> help me and today it'll be fixed in CVS. JOCxd> alex JOCxd> Monday, March 24, 2003, 3:45:54 PM, Simone Milani wrote: SM>> Hi Alex, SM>> Thanks! Do I have to expose the FK field in my ChildBean? Could JOCxd> you SM>> provide an example? SM>> Thanks!!!! SM>> Simone SM>> ----- Original Message ----- SM>> From: "Alex Loubyansky" <[EMAIL PROTECTED]> SM>> To: "Jonathan.O'[EMAIL PROTECTED]" <[EMAIL PROTECTED]> SM>> Sent: Monday, March 24, 2003 12:06 PM SM>> Subject: Re[2]: [JBoss-user] CMR with FK in the database >>> JBoss-3.2 now supports NON-NULL foreig keys if foreign key fields are >>> mapped to NON NULL CMP fields. >>> >>> alex >>> >>> Monday, March 24, 2003, 1:50:17 PM, Jonathan O'Connor wrote: >>> >>> JOCxd> Simone, >>> JOCxd> Look for previous messages about INSERT after ejbPostCreate. >>> JOCxd> If you use oracle you can also mark the NON NULL constraint as SM>> DEFERRABLE >>> JOCxd> INITIALLY DEFERRED. However, lots of DBAs don't like this. >>> JOCxd> Ciao, >>> JOCxd> Jonathan O'Connor >>> >>> >>> >>> >>> >>> JOCxd> "Simone Milani" <[EMAIL PROTECTED]> >>> JOCxd> Sent by: [EMAIL PROTECTED] >>> JOCxd> 24.03.2003 10:43 >>> JOCxd> Please respond to jboss-user >>> >>> >>> JOCxd> To: <[EMAIL PROTECTED]> >>> JOCxd> cc: >>> JOCxd> Subject: [JBoss-user] CMR with FK in the database >>> >>> >>> JOCxd> Hi, >>> >>> JOCxd> I have a one to many relation with a FK constaint and the FK JOCxd> in SM>> the >>> JOCxd> children declared as non nullable. The SQL that is generated by SM>> JBoss >>> JOCxd> seems to violate this constraint. >>> >>> JOCxd> Please help!!! >>> >>> >>> JOCxd> Thanks >>> >>> JOCxd> Simone ------------------------------------------------------- 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
