public interface EntityManagerFactoryBuilder
Represents 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 via build().
If anything goes wrong during either phase and the bootstrap process needs to be aborted, cancel() should
be called.
| Modifier and Type | Method and Description |
|---|---|
EntityManagerFactory |
build()
Build
EntityManagerFactory instance |
void |
cancel()
Cancel the building processing.
|
void |
generateSchema()
Perform an explicit schema generation (rather than an "auto" one) based on the
|
EntityManagerFactoryBuilder |
withDataSource(DataSource dataSource)
Allows passing in a DataSource (delayed from constructing the builder, AKA phase 2) to be used
in building the EntityManagerFactory
|
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
|
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 ValidatorFactorythis, for method chainingEntityManagerFactoryBuilder 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 usethis, for method chainingEntityManagerFactory build()
Build EntityManagerFactory instance
EntityManagerFactoryvoid 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
void generateSchema()
Perform an explicit schema generation (rather than an "auto" one) based on the
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.