Esempio n. 1
0
 public boolean isStoreRequired(CmpEntityBeanContext ctx) {
   boolean modified = false;
   final EntityState entityState = getEntityState(ctx);
   if (entityState.isCreated()) {
     modified = areCmpFieldsDirty(ctx, entityState);
     if (!modified) {
       for (int i = 0; i < cmrFields.length; ++i) {
         if (cmrFields[i].isDirty(ctx)) {
           modified = true;
           break;
         }
       }
     }
   }
   return modified;
 }
Esempio n. 2
0
 /**
  * This method is used to determined whether the instance was modified. NOTE, even if the method
  * returns true the isStoreRequired for this same instance might return false, e.g. a CMR field
  * that doesn't have a foreign key was modified.
  *
  * @param ctx
  * @return
  */
 public boolean isModified(CmpEntityBeanContext ctx) {
   boolean invalidateCache = false;
   final EntityState entityState = getEntityState(ctx);
   if (entityState.isCreated()) {
     invalidateCache = areCmpFieldsDirty(ctx, entityState);
     if (!invalidateCache) {
       for (int i = 0; i < cmrFields.length; ++i) {
         if (cmrFields[i].invalidateCache(ctx)) {
           invalidateCache = true;
           break;
         }
       }
     }
   }
   return invalidateCache;
 }