All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.guicedee.guicedpersistence.db.annotations.Transactional Maven / Gradle / Ivy

Go to download

A complete JPA 2.1 implementation for Standalone or EE Implementation. Enables Multiple Persistence units with full JTA Support using BTM. Perfect for Guice implementations, test suites, and Guice enabled Web Applications or EAR Projects. Requires JDK 8

There is a newer version: 62
Show newest version
package com.guicedee.guicedpersistence.db.annotations;

import java.lang.annotation.*;

/**
 * Transactional annotation for JPA to use specific entity manager annotation as registered in the abstract module
 */
@Target({ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@Documented
@SuppressWarnings("unused")
public @interface Transactional
{
	/**
	 * Entity manager annotation as registered in the abstract module
	 *
	 * @return The class type for the annotation that identifies the entity manager to use
	 */
	Class entityManagerAnnotation();

	/**
	 * The timeout applied for this transaction
	 *
	 * Great for debugging and applying a custom timeout
	 *
	 * @return Default of 30 seconds (30)
	 */
	int timeout() default 30;

	/**
	 * A list of exceptions to rollback on, if thrown by the transactional method. These exceptions
	 * are propagated correctly after a rollback.
	 */
	Class[] rollbackOn() default RuntimeException.class;

	/**
	 * A list of exceptions to not rollback on. A caveat to the rollbackOn clause. The
	 * disjunction of rollbackOn and ignore represents the list of exceptions that will trigger a
	 * rollback. The complement of rollbackOn and the universal set plus any exceptions in the ignore
	 * set represents the list of exceptions that will trigger a commit. Note that ignore exceptions
	 * take precedence over rollbackOn, but with subtype granularity.
	 */
	Class[] ignore() default {};
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy