Example usage for javax.persistence PersistenceContextType TRANSACTION

List of usage examples for javax.persistence PersistenceContextType TRANSACTION

Introduction

In this page you can find the example usage for javax.persistence PersistenceContextType TRANSACTION.

Prototype

PersistenceContextType TRANSACTION

To view the source code for javax.persistence PersistenceContextType TRANSACTION.

Click Source Link

Document

Transaction-scoped persistence context

Usage

From source file:mx.com.misha.demo.trabajadornomina.persistence.TrabajadorDaoImpl.java

@PersistenceContext(name = "TrabajadorNominaPU", type = PersistenceContextType.TRANSACTION)
public void setEntityManager(EntityManager em) {
    this.em = em;
}

From source file:it.av.es.service.impl.CittaServiceHibernate.java

/**
 * @param entityManager// w  w w  .  j av  a  2  s .com
 */
@PersistenceContext(type = PersistenceContextType.TRANSACTION, unitName = "easyTrackPersistence")
public void setInternalEntityManager(final EntityManager entityManager) {
    this.entityManager = entityManager;
}

From source file:com.impetus.kundera.persistence.EntityManagerImpl.java

private void checkTransactionNeeded() {
    onLookUp(transactionType);/*from w ww.  ja  v  a 2  s  .com*/

    if ((getPersistenceContextType() != PersistenceContextType.TRANSACTION)
            || (getPersistenceDelegator().isTransactionInProgress())) {
        return;
    }
    throw new TransactionRequiredException(
            "no transaction is in progress for a TRANSACTION type persistence context");
}