-
1. Re: CMR fields and referential integrity
timfox May 21, 2002 11:23 AM (in response to timfox)forgot to say I am using 3.0RC3
-
2. Re: CMR fields and referential integrity
pluellen May 21, 2002 5:23 PM (in response to timfox)>>does Jboss expect me to drop referential integrity on my database so I can persist ejbs with CMR relations??
Tim,
I'm not the expert here but, yes, I think at this point your foreign key columns must allow null. See thread http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ -
3. Re: CMR fields and referential integrity
timfox May 21, 2002 6:41 PM (in response to timfox)hi pluellen-
thanks for your reply.
i've always been taught that having nullable foreign keys is a big no no.
and anyway I can't drop the foreign keys since the database is already in production and used by other apps..... ouch
another possible solution is to have a before insert trigger on the table and insert a "special" foreign key that points at a special dummy record when null is attempted to be inserted.
this is a kludge though and I'd rather not have to do it.
hopefully this will be implemented soon as it seems a BIG oversight... -
4. Re: CMR fields and referential integrity
dsundstrom May 22, 2002 2:05 AM (in response to timfox)It is not an oversite. I knew exaxtally what I was forcing users into when I wrote it.
Support for this is not easy. The EJB spec does alot to make it even harder, and you are only looking at creation; there is an equal problem on removal. This will be added in a future release (3.1 most likely). -
5. Re: CMR fields and referential integrity
timfox May 22, 2002 4:03 AM (in response to timfox)Hi Dain-
sorry for assuming it's an oversight - a bit presumptious on my behalf.
anyway, the trigger workaround should allow me to do what i want now.
cheers