Examples of SpiTransaction


Examples of com.avaje.ebeaninternal.api.SpiTransaction

      allowOneManyFetch = false;
    }

    query.convertManyFetchJoinsToQueryJoins(allowOneManyFetch, queryBatchSize);

    SpiTransaction serverTrans = (SpiTransaction) t;
    OrmQueryRequest<T> request = new OrmQueryRequest<T>(this, queryEngine, query, desc, serverTrans);

    BeanQueryAdapter queryAdapter = desc.getQueryAdapter();
    if (queryAdapter != null) {
      // adaption of the query probably based on the
View Full Code Here

Examples of com.avaje.ebeaninternal.api.SpiTransaction

   * Try to get the object out of the persistence context.
   */
  @SuppressWarnings("unchecked")
  private <T> T findIdCheckPersistenceContextAndCache(Transaction transaction, BeanDescriptor<T> beanDescriptor, SpiQuery<T> query) {

    SpiTransaction t = (SpiTransaction) transaction;
    if (t == null) {
      t = getCurrentServerTransaction();
    }
    PersistenceContext context = null;
    if (t != null) {
      // first look in the persistence context
      context = t.getPersistenceContext();
      if (context != null) {
        WithOption o = context.getWithOption(beanDescriptor.getBeanType(), query.getId());
        if (o != null) {
          if (o.isDeleted()) {
            // Bean was previously deleted in the same transaction / persistence context
View Full Code Here

Examples of com.avaje.ebeaninternal.api.SpiTransaction

    // transfer the persistence content from the transaction
    if (spiQuery.getPersistenceContext() == null) {
      if (t != null) {
        spiQuery.setPersistenceContext(((SpiTransaction) t).getPersistenceContext());
      } else {
        SpiTransaction st = getCurrentServerTransaction();
        if (st != null) {
          spiQuery.setPersistenceContext(st.getPersistenceContext());
        }
      }
    }

    // Create a new transaction solely to execute the findList() at some future time
View Full Code Here

Examples of com.avaje.ebeaninternal.api.SpiTransaction

    // we want to use a single PersistenceContext to be used
    // for all the paging queries so we make sure there is a
    // PersistenceContext on the query
    PersistenceContext pc = spiQuery.getPersistenceContext();
    if (pc == null) {
      SpiTransaction currentTransaction = getCurrentServerTransaction();
      if (currentTransaction != null) {
        pc = currentTransaction.getPersistenceContext();
      }
      if (pc == null) {
        pc = new DefaultPersistenceContext();
      }
      spiQuery.setPersistenceContext(pc);
View Full Code Here

Examples of com.avaje.ebeaninternal.api.SpiTransaction

      return;
    }
   
    TransWrapper wrap = initTransIfRequired(t);
    try {
      SpiTransaction trans = wrap.transaction;
      for (Object bean : beans) {
        update(checkEntityBean(bean), trans);
      }
      wrap.commitIfCreated();
     
View Full Code Here

Examples of com.avaje.ebeaninternal.api.SpiTransaction

      return;
    }
   
    TransWrapper wrap = initTransIfRequired(t);
    try {
      SpiTransaction trans = wrap.transaction;
      for (Object bean : beans) {
        persister.insert(checkEntityBean(bean), trans);
      }
      wrap.commitIfCreated();
     
View Full Code Here

Examples of com.avaje.ebeaninternal.api.SpiTransaction

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

    EntityBean owner = checkEntityBean(ownerBean);
    TransWrapper wrap = initTransIfRequired(t);
    try {
      SpiTransaction trans = wrap.transaction;
      int rc = persister.deleteManyToManyAssociations(owner, propertyName, trans);
      wrap.commitIfCreated();
      return rc;

    } catch (RuntimeException e) {
View Full Code Here

Examples of com.avaje.ebeaninternal.api.SpiTransaction

  public void saveManyToManyAssociations(Object ownerBean, String propertyName, Transaction t) {

    EntityBean owner = checkEntityBean(ownerBean);
    TransWrapper wrap = initTransIfRequired(t);
    try {
      SpiTransaction trans = wrap.transaction;

      persister.saveManyToManyAssociations(owner, propertyName, trans);

      wrap.commitIfCreated();
View Full Code Here

Examples of com.avaje.ebeaninternal.api.SpiTransaction

    EntityBean owner = checkEntityBean(ownerBean);
   
    TransWrapper wrap = initTransIfRequired(t);
    try {
      SpiTransaction trans = wrap.transaction;
      persister.saveAssociation(owner, propertyName, trans);

      wrap.commitIfCreated();

    } catch (RuntimeException e) {
View Full Code Here

Examples of com.avaje.ebeaninternal.api.SpiTransaction

   */
  public int save(Iterator<?> it, Transaction t) {

    TransWrapper wrap = initTransIfRequired(t);
    try {
      SpiTransaction trans = wrap.transaction;
      int saveCount = 0;
      while (it.hasNext()) {
        EntityBean bean = checkEntityBean(it.next());
        persister.save(bean, trans);
        saveCount++;
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.