Package com.avaje.ebeaninternal.api

Examples of com.avaje.ebeaninternal.api.SpiTransaction.depth()


        EntityBean detailBean = prop.getValueAsEntityBean(parentBean);
        if (detailBean != null) {
          if (prop.isSaveRecurseSkippable(detailBean)) {
            // skip saving this bean
          } else {
            t.depth(+1);
            prop.setParentBeanToChild(parentBean, detailBean);
            saveRecurse(detailBean, t, parentBean, insertMode);
            t.depth(-1);
          }
        }
View Full Code Here


            // skip saving this bean
          } else {
            t.depth(+1);
            prop.setParentBeanToChild(parentBean, detailBean);
            saveRecurse(detailBean, t, parentBean, insertMode);
            t.depth(-1);
          }
        }
      }
    }
View Full Code Here

      Set<?> modifyRemovals = c.getModifyRemovals();
      if (modifyRemovals != null && !modifyRemovals.isEmpty()) {

        SpiTransaction t = saveMany.getTransaction();
        // increase depth for batching order
        t.depth(+1);
        for (Object removedBean : modifyRemovals) {
          if (removedBean instanceof EntityBean) {
            EntityBean eb = (EntityBean)removedBean;
            if (eb._ebean_getIntercept().isLoaded()) {
              // only delete if the bean was loaded meaning that
View Full Code Here

              // it is know to exist in the DB
              deleteRecurse(removedBean, t);
            }
          }
        }
        t.depth(-1);
      }
    }
  }

  /**
 
View Full Code Here

      detailIds = new ArrayList<Object>();
    }

    // increase depth for batching order
    SpiTransaction t = saveMany.getTransaction();
    t.depth(+1);

    // if a map, then we get the key value and
    // set it to the appropriate property on the
    // detail bean before we save it
    boolean isMap = ManyType.JAVA_MAP.equals(prop.getManyType());
View Full Code Here

    if (detailIds != null) {
      // deleteMissingChildren is true so deleting children that were not just processed
      deleteManyDetails(t, prop.getBeanDescriptor(), parentBean, prop, detailIds);
    }

    t.depth(-1);
  }

  public int deleteManyToManyAssociations(EntityBean ownerBean, String propertyName, Transaction t) {

    BeanDescriptor<?> descriptor = beanDescriptorManager.getBeanDescriptor(ownerBean.getClass());
View Full Code Here

      EntityBean assocBean = oneProp.getValueAsEntityBean(parentBean);

      int depth = oneProp.isOneToOneExported() ? 1 : -1;
      int revertDepth = -1 * depth;

      trans.depth(depth);
      saveRecurse(assocBean, t, parentBean, true);
      trans.depth(revertDepth);

    } else {
      String msg = "Expecting [" + prop.getFullBeanName() + "] to be a OneToMany, OneToOne, ManyToOne or ManyToMany property?";
View Full Code Here

      int depth = oneProp.isOneToOneExported() ? 1 : -1;
      int revertDepth = -1 * depth;

      trans.depth(depth);
      saveRecurse(assocBean, t, parentBean, true);
      trans.depth(revertDepth);

    } else {
      String msg = "Expecting [" + prop.getFullBeanName() + "] to be a OneToMany, OneToOne, ManyToOne or ManyToMany property?";
      throw new PersistenceException(msg);
    }
View Full Code Here

      deletions = manyValue.getModifyRemovals();
      // reset so the changes are only processed once
      manyValue.modifyReset();
    }

    t.depth(+1);

    if (additions != null && !additions.isEmpty()) {
      for (Object other : additions) {
        EntityBean otherBean = (EntityBean)other;
        // the object from the 'other' side of the ManyToMany
View Full Code Here

        executeSqlUpdate(sqlDelete, t);
      }
    }

    // decrease the depth back to what it was
    t.depth(-1);
  }

  private int deleteAssocManyIntersection(EntityBean bean, BeanPropertyAssocMany<?> many, Transaction t) {

    // delete all intersection rows for this bean
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.