com.wideplay.warp.persist.jpa
Annotation Type JpaUnit


@Retention(value=RUNTIME)
public @interface JpaUnit

A guice binding annotation you should use to tell warp-persist the name of the JPA persistence unit you wish to use. Bind a string with the name to this annotation. For instance, if the name of your persistence unit is "myDb" you would add the following in one of your guice modules:

bindConstant().annotatedWith(JpaUnit.class).to("myDb"); If you are using multiple JPA configurations in the same project (multiple modules), bind to an instance of the JpaUnit annotation instead, specifying the module-level binding annotation used to create the persistence module: bindConstant().annotatedWith(JpaUnitInstance.of(MyDB.class)).to("myDb");

You must bind a string to this annotation if using JPA. And it must match a jpa unit named in your JPA persistence.xml.

Since:
1.0

Optional Element Summary
 Class<? extends Annotation> value
           
 

value

public abstract Class<? extends Annotation> value
Default:
com.wideplay.warp.persist.Defaults.DefaultUnit.class