User: dsundstrom
Date: 01/11/02 10:29:32
Modified: src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge
JDBCCMRFieldBridge.java
Log:
Added code to throw an IllegalStateExcpetion if the bean provider tries to
add a bean to a relationship that has not been full created (i.e., ejbCreate
has not completed successfully).
Revision Changes Path
1.10 +7 -1
jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCCMRFieldBridge.java
Index: JDBCCMRFieldBridge.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/jdbc/bridge/JDBCCMRFieldBridge.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- JDBCCMRFieldBridge.java 2001/11/01 22:36:30 1.9
+++ JDBCCMRFieldBridge.java 2001/11/02 18:29:32 1.10
@@ -44,7 +44,7 @@
* One for each role that entity has.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Dain Sundstrom</a>
- * @version $Revision: 1.9 $
+ * @version $Revision: 1.10 $
*/
public class JDBCCMRFieldBridge implements CMRFieldBridge {
// ------ Invocation messages ------
@@ -560,6 +560,12 @@
* any foreign key fields.
*/
public void addRelation(EntityEnterpriseContext myCtx, Object fk) {
+ if(!entity.isCreated(myCtx)) {
+ throw new IllegalStateException("A CMR field cannot be set or added " +
+ "to a relationship in ejbCreate; this should be done in the " +
+ "ejbPostCreate method instead.");
+ }
+
load(myCtx);
FieldState fieldState = getFieldState(myCtx);
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development