Source Taste: Hibernate/JPA: PersistenceContextType & PersistenceUnitTransactionType

949 단어
package javax.persistence;

/**
 * Specifies whether a transaction-scoped or extended
 * persistence context is to be used in {@link PersistenceContext}.
 * If not specified, a transaction-scoped persistence context is used.
 *
 * @since Java Persistence 1.0
 */
public enum PersistenceContextType {

	/**
	 * Transaction-scoped persistence context
	 */
	TRANSACTION,

	/**
	 * Extended persistence context
	 */
	EXTENDED
}

THINK: When to use 'EXTENDED'?
package javax.persistence.spi;

/**
 * Specifies whether entity managers created by the {@link
 * javax.persistence.EntityManagerFactory} will be JTA or
 * resource-local entity managers.
 *
 * @since Java Persistence 1.0
 */
public enum PersistenceUnitTransactionType {
	/**
	 * JTA entity managers will be created.
	 */
	JTA,

	/**
	 * Resource-local entity managers will be created.
	 */
	RESOURCE_LOCAL
}

좋은 웹페이지 즐겨찾기