Package com.avaje.ebean.bean

Examples of com.avaje.ebean.bean.EntityBean


        // handled by DeleteUnloadedForeignKeys that was built
        // via getDeleteUnloadedForeignKeys();
      } else {
        Object detailBean = prop.getValue(request.getEntityBean());
        if (detailBean != null) {
          EntityBean detail = (EntityBean)detailBean;
          if (prop.hasId(detail)) {
            deleteRecurse(detail, request.getTransaction());
          }
        }
      }
View Full Code Here


    if (idProp == null || idProp.isEmbedded()) {
      // not supporting IdGeneration for concatenated or Embedded
      return;
    }

    EntityBean bean = request.getEntityBean();
    Object uid = idProp.getValue(bean);

    if (DmlUtil.isNullOrZero(uid)) {

      // generate the nextId and set it to the property
View Full Code Here

    BeanManager<T> mgr = getBeanManager(bean);
    if (mgr == null) {
      throw new PersistenceException(errNotRegistered(bean.getClass()));
    }
    BeanDescriptor<T> desc = mgr.getBeanDescriptor();
    EntityBean entityBean = (EntityBean)bean;
    // determine Insert or Update based on bean state and insert flag
    PersistRequest.Type type = desc.isInsertMode(entityBean._ebean_getIntercept(), insertMode) ? Type.INSERT : Type.UPDATE;
    return createRequest(bean, t, parentBean, mgr, type, true);
  }
View Full Code Here

  @SuppressWarnings("unchecked")
  protected T buildBeanFromLineContent(int row, String[] line) {

    try {
      EntityBean entityBean = descriptor.createEntityBean();
      T bean = (T) entityBean;

      int columnPos = 0;
      for (; columnPos < line.length; columnPos++) {
        convertAndSetColumn(columnPos, line[columnPos], entityBean);
View Full Code Here

    public void loadMany(BeanCollection<?> bc, boolean onlyIds) {

      synchronized (this) {
        boolean useCache = context.hitCache && !onlyIds;
        if (useCache) {
          EntityBean ownerBean = bc.getOwnerBean();
          BeanDescriptor<? extends Object> parentDesc = context.desc.getBeanDescriptor(ownerBean.getClass());
          Object parentId = parentDesc.getId(ownerBean);
          if (parentDesc.cacheManyPropLoad(context.property, bc, parentId, context.parent.isReadOnly())) {
            // we loaded the bean from cache
            list.remove(bc);
            return;
View Full Code Here

    ArrayList<Object> idList = new ArrayList<Object>(batchSize);

    for (int i = 0; i < batch.size(); i++) {
      BeanCollection<?> bc = batch.get(i);
      EntityBean ownerBean = bc.getOwnerBean();
      Object id = many.getParentId(ownerBean);
      idList.add(id);
    }
    int extraIds = batchSize - batch.size();
    if (extraIds > 0) {
View Full Code Here

    loadRequest.logSecondaryQuery(query);
  }

  public void loadMany(BeanCollection<?> bc, boolean onlyIds) {

    EntityBean parentBean = bc.getOwnerBean();
    String propertyName = bc.getPropertyName();

    //ObjectGraphNode node = ctx == null ? null : ctx.getObjectGraphNode();

    loadManyInternal(parentBean, propertyName, null, false, null, onlyIds);
View Full Code Here

    EntityBeanIntercept[] ebis = batch.toArray(new EntityBeanIntercept[batch.size()]);
    ArrayList<Object> idList = new ArrayList<Object>(batchSize);

    for (int i = 0; i < batch.size(); i++) {
      EntityBeanIntercept ebi = batch.get(i);
      EntityBean bean = ebi.getOwner();
      Object id = desc.getId(bean);
      idList.add(id);
    }

    if (idList.isEmpty()) {
View Full Code Here

    PersistenceContext pc = ebi.getPersistenceContext();

    BeanDescriptor<?> desc = server.getBeanDescriptor(bean.getClass());
    if (EntityType.EMBEDDED == desc.getEntityType()) {
      // lazy loading on an embedded bean property
      EntityBean embeddedOwner = (EntityBean)ebi.getEmbeddedOwner();
      int ownerIndex = ebi.getEmbeddedOwnerIndex();

      refreshBeanInternal(embeddedOwner, mode, ownerIndex);
    }
   
View Full Code Here

    if (exportedProperties.length == 1) {
      sqlUpd.addParameter(parentId);
      return;
    }
    EntityBean parent = (EntityBean) parentId;
    for (int i = 0; i < exportedProperties.length; i++) {
      Object embVal = exportedProperties[i].getValue(parent);
      sqlUpd.addParameter(embVal);
    }
  }
View Full Code Here

TOP

Related Classes of com.avaje.ebean.bean.EntityBean

Copyright © 2018 www.massapicom. 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.