User: dsundstrom
  Date: 02/02/12 14:35:11

  Modified:    src/main/org/jboss/ejb/plugins/cmp/bridge
                        EntityBridgeInvocationHandler.java FieldBridge.java
  Log:
  Fixed code that throws an exception if bean provider attempts to set a
  primary key field out side of ejbCreate or if the bean provider attempts
  to add a bean to a relation inside of ejbCreate.
  
  Revision  Changes    Path
  1.13      +3 -7      
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.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- EntityBridgeInvocationHandler.java        28 Jan 2002 21:43:12 -0000      1.12
  +++ EntityBridgeInvocationHandler.java        12 Feb 2002 22:35:11 -0000      1.13
  @@ -37,7 +37,7 @@
    *      One per cmp entity bean instance, including beans in pool.       
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Dain Sundstrom</a>
  - * @version $Revision: 1.12 $
  + * @version $Revision: 1.13 $
    */                            
   public class EntityBridgeInvocationHandler implements InvocationHandler {
      private final EntityContainer container;
  @@ -110,13 +110,9 @@
         }
   
         if(methodName.startsWith("get")) {
  -         return field.getInstanceValue(ctx);
  +         return field.getValue(ctx);
         } else if(methodName.startsWith("set")) {
  -         if(field.isReadOnly()) {
  -            throw new EJBException("Field is read-only: " +
  -                  "fieldName=" + field.getFieldName());
  -         }
  -         field.setInstanceValue(ctx, args[0]);
  +         field.setValue(ctx, args[0]);
            return null;
         }
         // Should never get here, but it's better to be safe then sorry.
  
  
  
  1.2       +3 -9      jboss/src/main/org/jboss/ejb/plugins/cmp/bridge/FieldBridge.java
  
  Index: FieldBridge.java
  ===================================================================
  RCS file: 
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/cmp/bridge/FieldBridge.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- FieldBridge.java  15 Jan 2002 20:40:15 -0000      1.1
  +++ FieldBridge.java  12 Feb 2002 22:35:11 -0000      1.2
  @@ -19,7 +19,7 @@
    *      One for each entity bean field.       
    *
    * @author <a href="mailto:[EMAIL PROTECTED]";>Dain Sundstrom</a>
  - * @version $Revision: 1.1 $
  + * @version $Revision: 1.2 $
    */                            
   public interface FieldBridge {
      /**
  @@ -29,23 +29,17 @@
      public String getFieldName();
      
      /**
  -    * Is this field read only.
  -    * @return true if this field is read only
  -    */ 
  -   public boolean isReadOnly();
  -      
  -   /**
       * Gets the value of this field for the specified instance context.
       * @param ctx the context for which this field's value should be fetched
       * @return the value of this field
       */
  -   public Object getInstanceValue(EntityEnterpriseContext ctx);
  +   public Object getValue(EntityEnterpriseContext ctx);
         
      /**
       * Sets the value of this field for the specified instance context.
       * @param ctx the context for which this field's value should be set
       * @param value the new value of this field
       */
  -   public void setInstanceValue(EntityEnterpriseContext ctx, Object value);
  +   public void setValue(EntityEnterpriseContext ctx, Object value);
   
   }
  
  
  

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

Reply via email to