public final class EntityManagerFactoryBuilder.Builder extends Object
Modifier and Type | Method and Description |
---|---|
LocalContainerEntityManagerFactoryBean |
build() |
EntityManagerFactoryBuilder.Builder |
jta(boolean jta)
Configure if using a JTA
DataSource , i.e. |
EntityManagerFactoryBuilder.Builder |
mappingResources(String... mappingResources)
The mapping resources (equivalent to
<mapping-file> entries in
persistence.xml ) for the persistence unit. |
EntityManagerFactoryBuilder.Builder |
packages(Class<?>... basePackageClasses)
The classes whose packages should be scanned for
@Entity annotations. |
EntityManagerFactoryBuilder.Builder |
packages(String... packagesToScan)
The names of packages to scan for
@Entity annotations. |
EntityManagerFactoryBuilder.Builder |
persistenceUnit(String persistenceUnit)
The name of the persistence unit.
|
EntityManagerFactoryBuilder.Builder |
properties(Map<String,?> properties)
Generic properties for standard JPA or vendor-specific configuration.
|
public EntityManagerFactoryBuilder.Builder packages(String... packagesToScan)
@Entity
annotations.packagesToScan
- packages to scanpublic EntityManagerFactoryBuilder.Builder packages(Class<?>... basePackageClasses)
@Entity
annotations.basePackageClasses
- the classes to usepublic EntityManagerFactoryBuilder.Builder persistenceUnit(String persistenceUnit)
persistenceUnit
- the name of the persistence unitpublic EntityManagerFactoryBuilder.Builder properties(Map<String,?> properties)
properties
- the properties to usepublic EntityManagerFactoryBuilder.Builder mappingResources(String... mappingResources)
<mapping-file>
entries in
persistence.xml
) for the persistence unit.
Note that mapping resources must be relative to the classpath root, e.g.
"META-INF/mappings.xml" or "com/mycompany/repository/mappings.xml", so that
they can be loaded through ClassLoader.getResource()
.
mappingResources
- the mapping resources to usepublic EntityManagerFactoryBuilder.Builder jta(boolean jta)
DataSource
, i.e. if
setDataSource
or
setJtaDataSource
should be called on the
LocalContainerEntityManagerFactoryBean
.jta
- if the data source is JTApublic LocalContainerEntityManagerFactoryBean build()