org.springframework.boot.orm.jpa

Class EntityManagerFactoryBuilder.Builder

  • java.lang.Object
    • org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder.Builder
  • Enclosing class:
    EntityManagerFactoryBuilder


    public final class EntityManagerFactoryBuilder.Builder
    extends Object
    A fluent builder for a LocalContainerEntityManagerFactoryBean.
    • Method Detail

      • packages

        public EntityManagerFactoryBuilder.Builder packages(String... packagesToScan)
        The names of packages to scan for @Entity annotations.
        Parameters:
        packagesToScan - packages to scan
        Returns:
        the builder for fluent usage
      • packages

        public EntityManagerFactoryBuilder.Builder packages(Class<?>... basePackageClasses)
        The classes whose packages should be scanned for @Entity annotations.
        Parameters:
        basePackageClasses - the classes to use
        Returns:
        the builder for fluent usage
      • persistenceUnit

        public EntityManagerFactoryBuilder.Builder persistenceUnit(String 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.
        Parameters:
        persistenceUnit - the name of the persistence unit
        Returns:
        the builder for fluent usage
      • properties

        public EntityManagerFactoryBuilder.Builder properties(Map<String,?> properties)
        Generic properties for standard JPA or vendor-specific configuration. These properties override any values provided in the constructor.
        Parameters:
        properties - the properties to use
        Returns:
        the builder for fluent usage
      • jta

        public EntityManagerFactoryBuilder.Builder jta(boolean jta)
        Configure if using a JTA DataSource, i.e. if setDataSource or setJtaDataSource should be called on the LocalContainerEntityManagerFactoryBean.
        Parameters:
        jta - if the data source is JTA
        Returns:
        the builder for fluent usage
      • build

        public org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean build()

Copyright © 2016 Pivotal Software, Inc.. All rights reserved.