接口 EntityManagerFactoryBuilder
-
- 所有已知实现类:
EntityManagerFactoryBuilderImpl
public interface EntityManagerFactoryBuilderRepresents a 2-phase JPA bootstrap process for building a Hibernate EntityManagerFactory. The first phase is the process of instantiating this builder. During the first phase, loading of Class references is highly discouraged. The second phase is building the EntityManagerFactory instance viabuild(). If anything goes wrong during either phase and the bootstrap process needs to be aborted,cancel()should be called.- 作者:
- Steve Ebersole, Scott Marlow
-
-
方法概要
所有方法 实例方法 抽象方法 修饰符和类型 方法 说明 javax.persistence.EntityManagerFactorybuild()BuildEntityManagerFactoryinstancevoidcancel()Cancel the building processing.voidgenerateSchema()Perform an explicit schema generation (rather than an "auto" one) based on theEntityManagerFactoryBuilderwithDataSource(DataSource dataSource)Allows passing in a DataSource (delayed from constructing the builder, AKA phase 2) to be used in building the EntityManagerFactoryEntityManagerFactoryBuilderwithValidatorFactory(Object validatorFactory)Allows passing in a Java EE ValidatorFactory (delayed from constructing the builder, AKA phase 2) to be used in building the EntityManagerFactory
-
-
-
方法详细资料
-
withValidatorFactory
EntityManagerFactoryBuilder withValidatorFactory(Object validatorFactory)
Allows passing in a Java EE ValidatorFactory (delayed from constructing the builder, AKA phase 2) to be used in building the EntityManagerFactory- 参数:
validatorFactory- The ValidatorFactory- 返回:
this, for method chaining
-
withDataSource
EntityManagerFactoryBuilder withDataSource(DataSource dataSource)
Allows passing in a DataSource (delayed from constructing the builder, AKA phase 2) to be used in building the EntityManagerFactory- 参数:
dataSource- The DataSource to use- 返回:
this, for method chaining
-
build
javax.persistence.EntityManagerFactory build()
BuildEntityManagerFactoryinstance- 返回:
- The built
EntityManagerFactory
-
cancel
void cancel()
Cancel the building processing. This is used to signal the builder to release any resources in the case of something having gone wrong during the bootstrap process
-
generateSchema
void generateSchema()
Perform an explicit schema generation (rather than an "auto" one) based on the
-
-