类 EntityManagerFactoryBuilder.Builder
java.lang.Object
org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder.Builder
A fluent builder for a LocalContainerEntityManagerFactoryBean.
-
方法概要
修饰符和类型方法说明build()
jta
(boolean jta) Configure if using a JTADataSource
, i.e. ifsetDataSource
orsetJtaDataSource
should be called on theLocalContainerEntityManagerFactoryBean
.managedTypes
(PersistenceManagedTypes managedTypes) The persistence managed types, providing both the managed entities and packages the entity manager should consider.mappingResources
(String... mappingResources) The mapping resources (equivalent to<mapping-file>
entries inpersistence.xml
) for the persistence unit.The classes whose packages should be scanned for@Entity
annotations.The names of packages to scan for@Entity
annotations.persistenceUnit
(String persistenceUnit) The name of the persistence unit.properties
(Map<String, ?> properties) Generic properties for standard JPA or vendor-specific configuration.
-
方法详细资料
-
managedTypes
The persistence managed types, providing both the managed entities and packages the entity manager should consider.- 参数:
managedTypes
- managed types.- 返回:
- the builder for fluent usage
-
packages
The names of packages to scan for@Entity
annotations.- 参数:
packagesToScan
- packages to scan- 返回:
- the builder for fluent usage
- 另请参阅:
-
packages
The classes whose packages should be scanned for@Entity
annotations.- 参数:
basePackageClasses
- the classes to use- 返回:
- the builder for fluent usage
- 另请参阅:
-
persistenceUnit
The name of the persistence unit. If only building one EntityManagerFactory you can omit this, but if there are more than one in the same application you should give them distinct names.- 参数:
persistenceUnit
- the name of the persistence unit- 返回:
- the builder for fluent usage
-
properties
Generic properties for standard JPA or vendor-specific configuration. These properties override any values provided in the constructor.- 参数:
properties
- the properties to use- 返回:
- the builder for fluent usage
-
mappingResources
The mapping resources (equivalent to<mapping-file>
entries inpersistence.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 use- 返回:
- the builder for fluent usage
-
jta
Configure if using a JTADataSource
, i.e. ifsetDataSource
orsetJtaDataSource
should be called on theLocalContainerEntityManagerFactoryBean
.- 参数:
jta
- if the data source is JTA- 返回:
- the builder for fluent usage
-
build
-