I currently have a number of CMP beans that have bi-directional CMRs. I am using
the value object pattern as implemented by XDoclet. I am running my EJBs on
JBoss 3.2.1 against Oracle 8i.
In coding my ejbCreate<METHOD>() and ejbPostCreate<METHOD>() methods, I have come
across something that I am curious how others have solved this (since it deals at
least partly with XDoclet's implementation of VOs).
It is my understanding that in the ejbCreate method you are supposed to get a
primary key, set it and return null. In my ejbPostCreate method, I set the
contents of the value object. However, when I do this (in JBoss), I get
complaints (in ejbCreate) from Oracle about my foreign key:
javax.ejb.CreateException: Could not create entity:java.sql.SQLException:
ORA-01400: cannot insert NULL into
("HR"."ASSIGNEDPOSITIONSTATE"."ASSIGNEDPOSITIONID")
Now, the contents of my foreign key relationships are in the value object, and
will be set in ejbPostCreate.
So there are a couple questions.
1. Should I be setting the values of my NOT NULL fields in ejbCreate()?
2. Is there some way that I can force JBoss 3.2.1 to hold it's horses, and set
the rest of the values in ejbPostCreate()?
Thanks in advance.
Troy
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user