Package com.avaje.ebeaninternal.server.transaction

Examples of com.avaje.ebeaninternal.server.transaction.DefaultPersistenceContext


  /**
   * For a bean built from the cache this sets up its persistence context for future lazy loading etc.
   */
  private void setupContext(Object bean, SpiQuery<T> query, PersistenceContext context) {
    if (context == null) {
      context = new DefaultPersistenceContext();
    }

    // Not using a loadContext for beans coming out of L2 cache
    // so that means no batch lazy loading for these beans
    EntityBean entityBean = (EntityBean)bean;
View Full Code Here


    private final PersistenceContext pc;
   
    public CopyContext(boolean vanillaMode, boolean sharing) {
        this.vanillaMode = vanillaMode;
        this.sharing = sharing;
        this.pc = new DefaultPersistenceContext();
    }
View Full Code Here

        for (int i = 0; i < propList.size(); i++) {
            sb.append(propList.get(i).getName()).append(",");
        }

        // run query in a separate persistence context
        q.setPersistenceContext(new DefaultPersistenceContext());
        q.setAutofetch(false);
        q.select(sb.toString());
        q.where().idEq(id);

        SpiTransaction t = request.getTransaction();
View Full Code Here

      SpiTransaction currentTransaction = getCurrentServerTransaction();
      if (currentTransaction != null) {
        pc = currentTransaction.getPersistenceContext();
      }
      if (pc == null) {
        pc = new DefaultPersistenceContext();
      }
      spiQuery.setPersistenceContext(pc);
    }

    return new LimitOffsetPagingQuery<T>(this, spiQuery, pageSize);
View Full Code Here

    }

    Object parentId = parentDesc.getId(parentBean);

    if (pc == null) {
      pc = new DefaultPersistenceContext();
      pc.put(parentId, parentBean);
    }

    boolean useManyIdCache = beanCollection != null && parentDesc.isManyPropCaching();
    if (useManyIdCache) {
View Full Code Here

   
    Object id = desc.getId(bean);

    if (pc == null) {
      // a reference with no existing persistenceContext
      pc = new DefaultPersistenceContext();
      pc.put(id, bean);
      if (ebi != null) {
        ebi.setPersistenceContext(pc);
      }
    }
View Full Code Here

  /**
   * For iterate queries reset the persistenceContext and loadContext.
   */
  public void flushPersistenceContextOnIterate() {
    persistenceContext = new DefaultPersistenceContext();
    loadContext.setPersistenceContext(persistenceContext);
  }
View Full Code Here

TOP

Related Classes of com.avaje.ebeaninternal.server.transaction.DefaultPersistenceContext

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.