Author: hansbak
Date: Sun Feb 3 01:14:56 2008 New Revision: 617966 URL: http://svn.apache.org/viewvc?rev=617966&view=rev Log: improved implementation of rev 616995 as suggested by david. Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java?rev=617966&r1=617965&r2=617966&view=diff ============================================================================== --- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java (original) +++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java Sun Feb 3 01:14:56 2008 @@ -216,12 +216,15 @@ // check to see if it exists, if so remove and count, if not just count already removed // always do a removeByAnd, if it was a removeByAnd great, if it was a removeByPrimaryKey, this will also work and save us a query - // however....removeByAnd also checks for the updateTimestamps....and they never match....so i changed it to remove primary key and only check for the primary key.....(hansbak) pkToRemove.setIsFromEntitySync(true); - // Debug.logInfo("try to remove: " + pkToRemove.getEntityName() + " key: " + pkToRemove.getPrimaryKey(), module); + // remove the stamp fields inserted by EntitySyncContext.java at or near line 646 + pkToRemove.remove(ModelEntity.STAMP_TX_FIELD); + pkToRemove.remove(ModelEntity.STAMP_FIELD); + pkToRemove.remove(ModelEntity.CREATE_STAMP_TX_FIELD); + pkToRemove.remove(ModelEntity.CREATE_STAMP_FIELD); - int numRemByAnd = delegator.removeByPrimaryKey(pkToRemove.getPrimaryKey()); + int numRemByAnd = delegator.removeByAnd(pkToRemove.getEntityName(), pkToRemove); if (numRemByAnd == 0) { toRemoveAlreadyDeleted++; } else { |
I think that looks better. Thanks for working on that stuff Hans. -David On Feb 3, 2008, at 2:15 AM, [hidden email] wrote: > Author: hansbak > Date: Sun Feb 3 01:14:56 2008 > New Revision: 617966 > > URL: http://svn.apache.org/viewvc?rev=617966&view=rev > Log: > improved implementation of rev 616995 as suggested by david. > > Modified: > ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/ > synchronization/EntitySyncServices.java > > Modified: ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/ > synchronization/EntitySyncServices.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/synchronization/EntitySyncServices.java?rev=617966&r1=617965&r2=617966&view=diff > = > = > = > = > = > = > = > = > ====================================================================== > --- ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/ > synchronization/EntitySyncServices.java (original) > +++ ofbiz/trunk/framework/entityext/src/org/ofbiz/entityext/ > synchronization/EntitySyncServices.java Sun Feb 3 01:14:56 2008 > @@ -216,12 +216,15 @@ > > // check to see if it exists, if so remove and > count, if not just count already removed > // always do a removeByAnd, if it was a removeByAnd > great, if it was a removeByPrimaryKey, this will also work and save > us a query > - // however....removeByAnd also checks for the > updateTimestamps....and they never match....so i changed it to > remove primary key and only check for the primary key.....(hansbak) > pkToRemove.setIsFromEntitySync(true); > > - // Debug.logInfo("try to remove: " + > pkToRemove.getEntityName() + " key: " + pkToRemove.getPrimaryKey(), > module); > + // remove the stamp fields inserted by > EntitySyncContext.java at or near line 646 > + pkToRemove.remove(ModelEntity.STAMP_TX_FIELD); > + pkToRemove.remove(ModelEntity.STAMP_FIELD); > + pkToRemove.remove(ModelEntity.CREATE_STAMP_TX_FIELD); > + pkToRemove.remove(ModelEntity.CREATE_STAMP_FIELD); > > - int numRemByAnd = > delegator.removeByPrimaryKey(pkToRemove.getPrimaryKey()); > + int numRemByAnd = > delegator.removeByAnd(pkToRemove.getEntityName(), pkToRemove); > if (numRemByAnd == 0) { > toRemoveAlreadyDeleted++; > } else { > > |
Free forum by Nabble | Edit this page |