User: dsundstrom
  Date: 01/12/12 11:43:11

  Modified:    src/main/org/jboss/ejb/plugins/cmp/bridge
                        EntityBridgeInvocationHandler.java
  Log:
  Added code to throw an exception is set is called on a readonly cmr field.
  
  Revision  Changes    Path
  1.10      +5 -1      
jboss/src/main/org/jboss/ejb/plugins/cmp/bridge/EntityBridgeInvocationHandler.java
  
  Index: EntityBridgeInvocationHandler.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/bridge/EntityBridgeInvocationHandler.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- EntityBridgeInvocationHandler.java        2001/12/07 17:51:28     1.9
  +++ EntityBridgeInvocationHandler.java        2001/12/12 19:43:11     1.10
  @@ -33,7 +33,7 @@
    *      One per cmp entity bean instance, including beans in pool.       
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Dain Sundstrom</a>
  - * @version $Revision: 1.9 $
  + * @version $Revision: 1.10 $
    */                            
   public class EntityBridgeInvocationHandler implements InvocationHandler {
      protected EntityContainer container;
  @@ -110,6 +110,10 @@
            if(methodName.startsWith("get")) {
               return cmrField.getValue(ctx);
            } else if(methodName.startsWith("set")) {
  +            if(cmrField.isReadOnly()) {
  +               throw new EJBException("Field is read-only: " +
  +                     cmrField.getFieldName());
  +            }
               if(!entityBridge.isCreated(ctx)) {
                  throw new IllegalStateException("A CMR field cannot be set " +
                        "in ejbCreate; this should be done in the ejbPostCreate " +
  
  
  

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to