Package play.db.jpa
Class DefaultJPAConfig
- Object
-
- play.db.jpa.DefaultJPAConfig
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultJPAConfig.JPAConfigProvider
-
Nested classes/interfaces inherited from interface play.db.jpa.JPAConfig
JPAConfig.PersistenceUnit
-
-
Constructor Summary
Constructors Constructor Description DefaultJPAConfig(Set<JPAConfig.PersistenceUnit> persistenceUnits)
DefaultJPAConfig(JPAConfig.PersistenceUnit... persistenceUnits)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static JPAConfig
from(Map<String,String> map)
Create a default JPA configuration from a map of names to unit names.static JPAConfig
of(String name, String unitName)
Create a default JPA configuration with the given name and unit name.static JPAConfig
of(String n1, String u1, String n2, String u2)
Create a default JPA configuration with the given names and unit names.static JPAConfig
of(String n1, String u1, String n2, String u2, String n3, String u3)
Create a default JPA configuration with the given names and unit names.Set<JPAConfig.PersistenceUnit>
persistenceUnits()
-
-
-
Constructor Detail
-
DefaultJPAConfig
public DefaultJPAConfig(Set<JPAConfig.PersistenceUnit> persistenceUnits)
-
DefaultJPAConfig
public DefaultJPAConfig(JPAConfig.PersistenceUnit... persistenceUnits)
-
-
Method Detail
-
persistenceUnits
public Set<JPAConfig.PersistenceUnit> persistenceUnits()
- Specified by:
persistenceUnits
in interfaceJPAConfig
-
of
public static JPAConfig of(String name, String unitName)
Create a default JPA configuration with the given name and unit name.- Parameters:
name
- the name for the entity manager factoryunitName
- the persistence unit name as used in `persistence.xml`- Returns:
- a default JPA configuration
-
of
public static JPAConfig of(String n1, String u1, String n2, String u2)
Create a default JPA configuration with the given names and unit names.- Parameters:
n1
- Name of the first entity manager factoryu1
- Name of the first unitn2
- Name of the second entity manager factoryu2
- Name of the second unit- Returns:
- a default JPA configuration with the provided persistence units.
-
of
public static JPAConfig of(String n1, String u1, String n2, String u2, String n3, String u3)
Create a default JPA configuration with the given names and unit names.- Parameters:
n1
- Name of the first entity manager factoryu1
- Name of the first unitn2
- Name of the second entity manager factoryu2
- Name of the second unitn3
- Name of the third entity manager factoryu3
- Name of the third unit- Returns:
- a default JPA configuration with the provided persistence units.
-
-