User: vharcq  
  Date: 02/05/24 14:00:56

  Modified:    modules/ejb/src/xdoclet/modules/ejb/entity/resources Tag:
                        MODULE_REFACTORING_BRANCH entity-body.xdt
                        entity-value-instantiation.xdt entity-value.xdt
  Removed:     modules/ejb/src/xdoclet/modules/ejb/entity/resources Tag:
                        MODULE_REFACTORING_BRANCH
                        entity-value-instantiation-eager.xdt
  Log:
  After discussion with Craig O'Shannessy.
  VO are now instantiate only once per instance of the bean on the first getter done.
  It is never reset to null after.
  When Getter is called we reset all fields inside the VO before returning it.
  We do not care about eager instantiation of it anymore.
  We do not care about maintaining VO consistent with entity bean value (that was a 
baad idea)
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.5   +0 -7      
xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity/resources/Attic/entity-body.xdt
  
  Index: entity-body.xdt
  ===================================================================
  RCS file: 
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity/resources/Attic/entity-body.xdt,v
  retrieving revision 1.1.2.4
  retrieving revision 1.1.2.5
  diff -u -w -r1.1.2.4 -r1.1.2.5
  --- entity-body.xdt   21 May 2002 18:49:59 -0000      1.1.2.4
  +++ entity-body.xdt   24 May 2002 21:00:55 -0000      1.1.2.5
  @@ -143,13 +143,6 @@
        <XDtEjbDataObj:ifIsWithDataContainer>
         dataHolder = null;
        </XDtEjbDataObj:ifIsWithDataContainer>
  -
  -     <XDtComment:comment>
  -     <XDtMerge:merge 
file="xdoclet/modules/ejb/entity/resources/entity-value-clean.xdt">
  -     </XDtMerge:merge>
  -     <XDtMerge:merge 
file="xdoclet/modules/ejb/entity/resources/entity-value-instantiation-eager.xdt">
  -     </XDtMerge:merge>
  -     </XDtComment:comment>
      }
   
      public void ejbStore() <XDtMethod:exceptionList method="ejbStore"/>
  
  
  
  1.1.2.2   +1 -3      
xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity/resources/Attic/entity-value-instantiation.xdt
  
  Index: entity-value-instantiation.xdt
  ===================================================================
  RCS file: 
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity/resources/Attic/entity-value-instantiation.xdt,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -w -r1.1.2.1 -r1.1.2.2
  --- entity-value-instantiation.xdt    9 May 2002 16:39:40 -0000       1.1.2.1
  +++ entity-value-instantiation.xdt    24 May 2002 21:00:56 -0000      1.1.2.2
  @@ -1,7 +1,5 @@
                        try
            {
  -            <XDtEjbValueObj:currentValueObjectAttribute/> = new 
<XDtEjbValueObj:currentValueObjectClass/>();
  -
            <XDtEjbPersistent:forAllPersistentFields 
valueobject="<XDtEjbValueObj:currentValueObjectMatch/>">
              <XDtMethod:ifHasMethod name="<XDtMethod:setterMethod/>" 
parameters="<XDtMethod:methodType/>">
               
<XDtEjbValueObj:currentValueObjectAttribute/>.<XDtMethod:setterMethod/>( 
<XDtMethod:getterMethod/>() );
  
  
  
  1.1.2.4   +8 -26     
xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity/resources/Attic/entity-value.xdt
  
  Index: entity-value.xdt
  ===================================================================
  RCS file: 
/cvsroot/xdoclet/xdoclet/modules/ejb/src/xdoclet/modules/ejb/entity/resources/Attic/entity-value.xdt,v
  retrieving revision 1.1.2.3
  retrieving revision 1.1.2.4
  diff -u -w -r1.1.2.3 -r1.1.2.4
  --- entity-value.xdt  21 May 2002 18:49:59 -0000      1.1.2.3
  +++ entity-value.xdt  24 May 2002 21:00:56 -0000      1.1.2.4
  @@ -121,19 +121,16 @@
     </XDtEjbValueObj:forAllRelations>
   
     <XDtEjbValueObj:forAllValueObjects>
  -   private <XDtEjbValueObj:currentValueObjectClass/> 
<XDtEjbValueObj:currentValueObjectAttribute/>;
  +   private <XDtEjbValueObj:currentValueObjectClass/> 
<XDtEjbValueObj:currentValueObjectAttribute/> = null;
   
      public <XDtEjbValueObj:valueMostSuperObjectClass/> 
get<XDtEjbValueObj:currentValueObjectAttribute/>()
      {
  -      <XDtEjbValueObj:ifIsNotCurrentValueObjectVolatile>
          if( <XDtEjbValueObj:currentValueObjectAttribute/> == null )
          {
  -      </XDtEjbValueObj:ifIsNotCurrentValueObjectVolatile>
  +          <XDtEjbValueObj:currentValueObjectAttribute/> = new 
<XDtEjbValueObj:currentValueObjectClass/>();
  +       }
                <XDtMerge:merge 
file="xdoclet/modules/ejb/entity/resources/entity-value-instantiation.xdt">
                </XDtMerge:merge>
  -      <XDtEjbValueObj:ifIsNotCurrentValueObjectVolatile>
  -       }
  -      </XDtEjbValueObj:ifIsNotCurrentValueObjectVolatile>
   
         <XDtEjbPersistent:forAllPersistentFields 
valueobject="<XDtEjbValueObj:currentValueObjectMatch/>">
         <XDtMethod:ifHasMethod name="<XDtMethod:setterMethod/>" 
parameters="<XDtMethod:methodType/>">
  @@ -154,8 +151,6 @@
          if( getVersion() != valueHolder.getVersion() )
                 throw new IllegalStateException( "Wrong version. Had " + getVersion() 
+ ", got " + valueHolder.getVersion() );
         </XDtEjbBmp:ifUseSoftLocking>
  -      if (<XDtEjbValueObj:currentValueObjectAttribute/> == null)
  -        <XDtEjbValueObj:currentValueObjectAttribute/> = new 
<XDtEjbValueObj:currentValueObjectClass/>();
   
          try
          {
  @@ -163,13 +158,11 @@
                <XDtEjbPk:ifIsNotPrimkeyField>
                <XDtMethod:ifHasMethod name="<XDtMethod:setterMethod/>" 
parameters="<XDtMethod:methodType/>">
                 <XDtMethod:setterMethod/>( valueHolder.<XDtMethod:getterMethod/>() );
  -              
this.<XDtEjbValueObj:currentValueObjectAttribute/>.<XDtMethod:setterMethod/>( 
valueHolder.<XDtMethod:getterMethod/>() );
                </XDtMethod:ifHasMethod>
                </XDtEjbPk:ifIsNotPrimkeyField>
          </XDtEjbPersistent:forAllPersistentFields>
   
          <XDtEjbValueObj:forAllAggregates superclasses="true" 
valueobject="<XDtEjbValueObj:valueObjectMatch/>">
  -       // Anonymous block to allow variable declations without conflicts
          {
           <XDtMethod:ifDoesntHaveMethodTag tagName="ejb:value-object" 
paramName="type">
   
  @@ -187,10 +180,8 @@
   
                 <XDtMethod:methodType/> relation = home.findByPrimaryKey(pk);
                 <XDtMethod:setterMethod/>(relation);
  -              
this.<XDtEjbValueObj:currentValueObjectAttribute/>.set<XDtEjbValueObj:currentAggregateName/>(
 valueHolder.get<XDtEjbValueObj:currentAggregateName/>() );
                </XDtMethod:ifDoesntHaveMethodTag>
                <XDtMethod:ifHasMethodTag tagName="ejb:value-object" paramName="type">
  -              
this.<XDtEjbValueObj:currentValueObjectAttribute/>.copy<XDtEjbValueObj:currentAggregateName/>sFrom(valueHolder);
   <XDtComment:comment>
   Here we take what has changed (update/add/remove) inside the VO collection and
   call methods according to.  These methods are extracted so that you can define
  @@ -230,10 +221,8 @@
   
                 <XDtMethod:methodType/> relation = home.findByPrimaryKey(pk);
                 
relation.set<XDtEjbValueObj:currentAggregateName/>(valueHolder.get<XDtEjbValueObj:currentAggregateName/>());
  -              
this.<XDtEjbValueObj:currentValueObjectAttribute/>.set<XDtEjbValueObj:currentAggregateName/>(
 home.findByPrimaryKey(pk).get<XDtEjbValueObj:currentAggregateName/>() );
                </XDtMethod:ifDoesntHaveMethodTag>
                <XDtMethod:ifHasMethodTag tagName="ejb:value-object" paramName="type">
  -              
this.<XDtEjbValueObj:currentValueObjectAttribute/>.copy<XDtEjbValueObj:currentAggregateName/>sFrom(valueHolder);
   <XDtComment:comment>
   Here we take what has changed (update/add/remove) inside the VO collection and
   call methods according to.  These methods are extracted so that you can define
  @@ -265,14 +254,7 @@
          {
                 throw new javax.ejb.EJBException(e);
          }
  -       <XDtComment:comment>
  -             Invalidates the internal VO object to force reloading from the
  -             the database the next time the VO is obtained
  -             TODO : think more about it ;)
  -       </XDtComment:comment>
  -      this.<XDtEjbValueObj:currentValueObjectAttribute/> = null;
      }
    </XDtEjbValueObj:forAllSuperSetValue>
  -
   
   /* Value Objects END */
  
  
  

_______________________________________________________________

Don't miss the 2002 Sprint PCS Application Developer's Conference
August 25-28 in Las Vegas -- http://devcon.sprintpcs.com/adp/index.cfm

_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to