Java 类org.springframework.orm.jpa.JpaVendorAdapter 实例源码

项目:only-short-poc    文件:MySqlSource1Config.java   
@Bean(EntityManagerFactoryBeanName)
@Primary
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
        @Qualifier(DataSourceBeanName) DataSource dataSource,
        @Qualifier(JpaVendorAdapterBeanName) JpaVendorAdapter vendorAdapter) {

    LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
    entityManagerFactoryBean.setDataSource(dataSource);
    entityManagerFactoryBean.setJpaVendorAdapter(vendorAdapter);
    entityManagerFactoryBean.setJpaDialect(new HibernateJpaDialect());
    entityManagerFactoryBean.setPackagesToScan(Organization.class.getPackage().getName());
    entityManagerFactoryBean.setPersistenceUnitName("mysqlsource1");
    entityManagerFactoryBean.afterPropertiesSet();

    return entityManagerFactoryBean;
}
项目:angular-spring-boot-micro-services-docker    文件:JPAConfig.java   
@Bean(name = "coreEntityManager")
public LocalContainerEntityManagerFactoryBean entityManagerFactory()
{
    if (driver == null){
        throw new IllegalStateException("cannot find db.type property with valid value ( mysql,ms-sql)");
    }
    driver.create();
    LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setDataSource(driver.create());
    em.setPackagesToScan(new String[]{"com"});
    JpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    vendorAdapter.setShowSql(false);
    vendorAdapter.setGenerateDdl(false);

    em.setJpaVendorAdapter(vendorAdapter);
    em.setJpaProperties(additionalProperties());
    return em;
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:JpaBaseConfiguration.java   
@Bean
@ConditionalOnMissingBean
public EntityManagerFactoryBuilder entityManagerFactoryBuilder(
        JpaVendorAdapter jpaVendorAdapter,
        ObjectProvider<PersistenceUnitManager> persistenceUnitManagerProvider) {
    EntityManagerFactoryBuilder builder = new EntityManagerFactoryBuilder(
            jpaVendorAdapter, this.properties.getProperties(),
            persistenceUnitManagerProvider.getIfAvailable());
    builder.setCallback(getVendorCallback());
    return builder;
}
项目:Spring-Framework-Essentials    文件:AppConfig.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
        DataSource dataSource, JpaVendorAdapter jpaVendorAdapter) {

    Properties props = new Properties();
    props.setProperty("hibernate.format_sql", String.valueOf(true));

    LocalContainerEntityManagerFactoryBean emf =
            new LocalContainerEntityManagerFactoryBean();
    emf.setDataSource(dataSource);
    emf.setPackagesToScan("com.oreilly.entities");
    emf.setJpaVendorAdapter(jpaVendorAdapter);
    emf.setJpaProperties(props);

    return emf;
}
项目:Spring-Framework-Essentials    文件:AppConfig.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
        DataSource dataSource, JpaVendorAdapter jpaVendorAdapter) {

    Properties props = new Properties();
    props.setProperty("hibernate.format_sql", String.valueOf(true));

    LocalContainerEntityManagerFactoryBean emf =
            new LocalContainerEntityManagerFactoryBean();
    emf.setDataSource(dataSource);
    emf.setPackagesToScan("com.oreilly.entities");
    emf.setJpaVendorAdapter(jpaVendorAdapter);
    emf.setJpaProperties(props);

    return emf;
}
项目:entelect-spring-webapp-template    文件:JPAConfig.java   
@Bean(name = "entityManagerFactory")
@DependsOn("flyway")
@Profile("sqlDb")
public LocalContainerEntityManagerFactoryBean serverEntityManagerFactory(DataSource dataSource,
                                                                         JpaVendorAdapter vendorAdapter,
                                                                         LoadTimeWeaver loadTimeWeaver,
                                                                         Properties hibernateProperties) {

    LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setDataSource(dataSource);
    em.setJpaVendorAdapter(vendorAdapter);
    em.setLoadTimeWeaver(loadTimeWeaver);
    em.setJpaProperties(hibernateProperties);
    em.setPackagesToScan(ENTITIES_PACKAGE);
    return em;
}
项目:invesdwin-context-persistence    文件:PersistenceUnitContext.java   
private EntityManagerFactory createEntityManagerFactory() {
    Assertions.assertThat(persistenceUnitContextManager.isValidPersistenceUnit(persistenceUnitName))
            .as("Not a valid persistence unit: %s", persistenceUnitName)
            .isTrue();
    final LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setPersistenceUnitManager(persistenceUnitManager);
    factory.setPersistenceUnitName(persistenceUnitName);
    final JpaVendorAdapter jpaVendorAdapter = getJpaVendorAdapter();
    if (jpaVendorAdapter != null) {
        factory.setJpaVendorAdapter(jpaVendorAdapter);
    } else {
        factory.setPersistenceProvider(getPersistenceProvider());
    }
    final JpaDialect jpaDialect = getJpaDialect();
    if (jpaDialect != null) {
        factory.setJpaDialect(jpaDialect);
    }
    factory.afterPropertiesSet();
    final String entityManagerFactoryBeanName = getPersistenceUnitName()
            + PersistenceProperties.ENTITY_MANAGER_FACTORY_NAME_SUFFIX;
    MergedContext.getInstance().registerBean(entityManagerFactoryBeanName, factory);
    Assertions.assertThat(MergedContext.getInstance().getBean(entityManagerFactoryBeanName)).isNotNull();
    return factory.getObject();
}
项目:herd    文件:DaoSpringModuleConfig.java   
/**
 * Gets the Hibernate JPA vendor adapter needed by the entity manager.
 *
 * @return the Hibernate JPA vendor adapter.
 */
private JpaVendorAdapter getHibernateJpaVendorAdapter()
{
    HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter();
    // Set the database type.
    String databaseType = configurationHelper.getProperty(ConfigurationValue.DATABASE_TYPE);
    if (StringUtils.isBlank(databaseType))
    {
        throw new IllegalStateException(
            String.format("No database type found. Ensure the \"%s\" configuration entry is configured.", ConfigurationValue.DATABASE_TYPE.getKey()));
    }
    Database database = Database.valueOf(databaseType);
    LOGGER.info("jpaTargetDatabase={}", database);
    hibernateJpaVendorAdapter.setDatabase(database);
    hibernateJpaVendorAdapter.setGenerateDdl(false);
    return hibernateJpaVendorAdapter;
}
项目:cwEnsaiosWeb    文件:JPAConfiguration.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();

    JpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();

    DriverManagerDataSource dataSource = new DriverManagerDataSource();
    dataSource.setUsername("root");
    dataSource.setPassword("");
    dataSource.setUrl("jdbc:mysql://localhost:3306/ensaiospring");
    dataSource.setDriverClassName("com.mysql.jdbc.Driver");

    Properties props = new Properties();
    props.setProperty("hibernate.dialect",
            "org.hibernate.dialect.MySQL5Dialect");
    props.setProperty("hibernate.show_sql", "true");
    props.setProperty("hibernate.hbm2ddl.auto", "update");

    factory.setJpaVendorAdapter(jpaVendorAdapter);
    factory.setDataSource(dataSource);
    factory.setJpaProperties(props);
    factory.setPackagesToScan("br.com.ciaware.springmvc.ensaio.models");

    return factory;
}
项目:cas-5.1.0    文件:JpaConfigDataHolder.java   
public JpaConfigDataHolder(final JpaVendorAdapter jpaVendorAdapter,
                           final String persistenceUnitName,
                           final String[] packagesToScan,
                           final DataSource dataSource) {
    this.jpaVendorAdapter = jpaVendorAdapter;
    this.persistenceUnitName = persistenceUnitName;
    this.packagesToScan = packagesToScan;
    this.dataSource = dataSource;
}
项目:JenkinsHue    文件:H2DBConfig.java   
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
    HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter();
    hibernateJpaVendorAdapter.setShowSql(true);
    hibernateJpaVendorAdapter.setGenerateDdl(true);
    hibernateJpaVendorAdapter.setDatabase(Database.H2);
    return hibernateJpaVendorAdapter;
}
项目:JenkinsHue    文件:CommonDBConfig.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
        JpaVendorAdapter jpaVendorAdapter) {
    LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
    lef.setDataSource(dataSource);
    lef.setJpaVendorAdapter(jpaVendorAdapter);
    lef.setPackagesToScan("de.adesso.jenkinshue.entity");
    lef.setJpaProperties(dataSourceConfig.getJpaProperties());
    lef.afterPropertiesSet();
    return lef;
}
项目:JenkinsHue    文件:PostgreSQLDBConfig.java   
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
    HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter();
    hibernateJpaVendorAdapter.setShowSql(sql);
    hibernateJpaVendorAdapter.setGenerateDdl(sql);
    hibernateJpaVendorAdapter.setDatabase(Database.POSTGRESQL);
    return hibernateJpaVendorAdapter;
}
项目:restaurant    文件:RepositoryConfiguration.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan("org.restaurant.repository.model");

JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
em.setJpaProperties(additionalProperties());

return em;
}
项目:only-short-poc    文件:MySqlSource2Config.java   
@Bean(EntityManagerFactoryBeanName)
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
        @Qualifier(DataSourceBeanName) DataSource dataSource,
        @Qualifier(JpaVendorAdapterBeanName) JpaVendorAdapter vendorAdapter) {

    LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
    entityManagerFactoryBean.setDataSource(dataSource);
    entityManagerFactoryBean.setJpaVendorAdapter(vendorAdapter);
    entityManagerFactoryBean.setJpaDialect(new HibernateJpaDialect());
    entityManagerFactoryBean.setPackagesToScan(Organization.class.getPackage().getName());
    entityManagerFactoryBean.setPersistenceUnitName("mysqlsource2");
    entityManagerFactoryBean.afterPropertiesSet();

    return entityManagerFactoryBean;
}
项目:social-media-analytic-system    文件:DataSourceConfig.java   
/**
 * Container managed JPA
 * This bean replaces <code>persistence.xml</code>
 * Defines packages to scan with {@link javax.persistence.Entity} annotation
 * @return Entity manager factory
 */
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource,
                                                                   JpaVendorAdapter jpaVendorAdapter){
    LocalContainerEntityManagerFactoryBean emfb = new LocalContainerEntityManagerFactoryBean();
    emfb.setDataSource(dataSource);
    emfb.setJpaVendorAdapter(jpaVendorAdapter);
    emfb.setPackagesToScan(PACKAGE_TO_SCAN_ENTITIES);
    return emfb;
}
项目:social-media-analytic-system    文件:DataSourceConfig.java   
/**
 * JPA vendor adapter provides specifics about particular JPA implementation to use
 * @return JPA vendor adapter
 */
@Bean
public JpaVendorAdapter jpaVendorAdapter(Environment env){
    HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
    adapter.setDatabase(Database.POSTGRESQL);
    adapter.setShowSql(Boolean.parseBoolean(env.getProperty(PROPERTY_JPA_SHOW_SQL)));
    adapter.setDatabasePlatform(env.getProperty(PROPERTY_JPA_DATABASE_PLATFORM));
    adapter.setGenerateDdl(Boolean.parseBoolean(env.getProperty(PROPERTY_JPA_GENERATE_DDL)));
    return adapter;
}
项目:CriteriaBuilder    文件:PersistenceJPAConfig.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory()
{
    LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setDataSource(dataSource());
    em.setPackagesToScan(new String[] { "com.bats.criteriagenerator.entity" });

    JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    em.setJpaVendorAdapter(vendorAdapter);
    em.setJpaProperties(additionalProperties());

    return em;
}
项目:training-sample    文件:AppConfig.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
    LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setDataSource(dataSource());
    em.setPackagesToScan(new String[] { "com.iisigroup.domain" });

    JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    em.setJpaVendorAdapter(vendorAdapter);
    em.setJpaProperties(hibernateProperties());

    return em;
}
项目:training-sample    文件:AppConfig.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
    LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setDataSource(dataSource());
    em.setPackagesToScan(new String[] { "com.iisigroup.domain" });

    JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    em.setJpaVendorAdapter(vendorAdapter);
    em.setJpaProperties(hibernateProperties());

    return em;
}
项目:dev-courses    文件:DomainAndPersitenceConfigManuelle.java   
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
    HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter();
    hibernateJpaVendorAdapter.setShowSql(false);
    hibernateJpaVendorAdapter.setGenerateDdl(false);
    hibernateJpaVendorAdapter.setDatabase(Database.H2);
    return hibernateJpaVendorAdapter;
}
项目:dev-courses    文件:DomainAndPersitenceConfigManuelle.java   
@Bean
public EntityManagerFactory entityManagerFactory(JpaVendorAdapter jpaVendorAdapter, DataSource dataSource) {
    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setJpaVendorAdapter(jpaVendorAdapter);
    factory.setPackagesToScan("todolist.entities");
    factory.setDataSource(dataSource);
    factory.afterPropertiesSet();
    return factory.getObject();
}
项目:dev-courses    文件:Config.java   
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
    HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter();
    hibernateJpaVendorAdapter.setShowSql(false);
    hibernateJpaVendorAdapter.setGenerateDdl(true);
    hibernateJpaVendorAdapter.setDatabase(Database.H2);
    return hibernateJpaVendorAdapter;
}
项目:dev-courses    文件:Config.java   
@Bean
public EntityManagerFactory entityManagerFactory(JpaVendorAdapter jpaVendorAdapter, DataSource dataSource) {
    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setJpaVendorAdapter(jpaVendorAdapter);
    factory.setPackagesToScan("hello.entities");
    factory.setDataSource(dataSource);
    factory.afterPropertiesSet();
    return factory.getObject();
}
项目:springuni-particles    文件:AbstractJpaRepositoryConfiguration.java   
/**
 * Creates the entity manager factory.
 *
 * @param dataSource the data source to use
 * @return entity manager factory
 */
@Bean
@Primary
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) {
  LocalContainerEntityManagerFactoryBean entityManagerFactoryBean =
      new LocalContainerEntityManagerFactoryBean();

  entityManagerFactoryBean.setDataSource(dataSource);

  JpaVendorAdapter jpaVendorAdapter = createJpaVendorAdapter();
  entityManagerFactoryBean.setJpaVendorAdapter(jpaVendorAdapter);

  Map<String, String> jpaPropertyMap = getJpaPropertyMap();
  entityManagerFactoryBean.setJpaPropertyMap(jpaPropertyMap);

  getMappingResources().ifPresent(entityManagerFactoryBean::setMappingResources);
  getPackagesToScan().ifPresent(entityManagerFactoryBean::setPackagesToScan);

  // https://hibernate.atlassian.net/browse/HHH-5303#comment-44439
  entityManagerFactoryBean.setSharedCacheMode(ENABLE_SELECTIVE);

  customizeEntityManagerFactoryBean(entityManagerFactoryBean);

  return entityManagerFactoryBean;
}
项目:amanda    文件:RootContextConfiguration.java   
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
    HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
    adapter.setDatabasePlatform("org.hibernate.dialect.MySQL5InnoDBDialect");
    adapter.setGenerateDdl(true);
    return adapter;
}
项目:keti    文件:AcsConfigUtil.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(final DataSource dataSource) {
    LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setDataSource(dataSource);
    em.setPackagesToScan(new String[] { "com.ge.predix.acs.service.policy.admin.dao",
            "com.ge.predix.acs.privilege.management.dao",
            "com.ge.predix.acs.zone.management.dao",
            "com.ge.predix.acs.attribute.connector.management.dao"
    });

    JpaVendorAdapter vendorAdapter = new OpenJpaVendorAdapter();
    em.setJpaVendorAdapter(vendorAdapter);
    return em;
}
项目:wormboard-backend    文件:DatabaseConfig.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource, JpaVendorAdapter jpaVendorAdapter)
{
  LocalContainerEntityManagerFactoryBean lef = new LocalContainerEntityManagerFactoryBean();
  lef.setDataSource(dataSource);
  lef.setJpaVendorAdapter(jpaVendorAdapter);
  lef.setPackagesToScan("com.fetoxdevelopments.wormboard.domain");
  return lef;
}
项目:wormboard-backend    文件:DatabaseConfig.java   
@Bean
public JpaVendorAdapter jpaVendorAdapter()
{
  HibernateJpaVendorAdapter hibernateJpaVendorAdapter = new HibernateJpaVendorAdapter();
  hibernateJpaVendorAdapter.setShowSql(false);
  hibernateJpaVendorAdapter.setGenerateDdl(false);
  hibernateJpaVendorAdapter.setDatabase(Database.POSTGRESQL);
  return hibernateJpaVendorAdapter;
}
项目:ismartonline    文件:JPAConfiguration.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource)
{
   LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
   em.setDataSource(dataSource);
   em.setPackagesToScan(new String[] { "br.org.ismart.ismartonline.models" });

   JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
   em.setJpaVendorAdapter(vendorAdapter);
   em.setJpaProperties(additionalProperties());

   return em;
}
项目:ismartonline    文件:JPAProductionConfiguration.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource)
{
   LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
   em.setDataSource(dataSource);
   em.setPackagesToScan(new String[] { "br.org.ismart.ismartonline.models" });

   JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
   em.setJpaVendorAdapter(vendorAdapter);
   em.setJpaProperties(additionalProperties());

   return em;
}
项目:pswot-cloud-java-spring-webapp    文件:JPAConfiguration.java   
@Bean // configuta EntityManager
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
        DataSource dataSource) {
    LocalContainerEntityManagerFactoryBean em
            = new LocalContainerEntityManagerFactoryBean();
    em.setDataSource(dataSource);
    em.setPackagesToScan(new String[]{"br.com.semanticwot.cd.models"});

    JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    em.setJpaVendorAdapter(vendorAdapter);
    em.setJpaProperties(additionalProperties());

    return em;
}
项目:interview-preparation    文件:DBConfig.java   
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
    final HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
    adapter.setDatabase(Database.MYSQL);
    adapter.setShowSql(true);
    adapter.setGenerateDdl(true);
    adapter.setDatabasePlatform("org.hibernate.dialect.MySQL5InnoDBDialect");
    return adapter;
}
项目:interview-preparation    文件:DatabaseConfig.java   
@Bean
public JpaVendorAdapter jpaVendorAdapter() {
    final HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
    adapter.setDatabase(Database.MYSQL);
    adapter.setShowSql(true);
    adapter.setGenerateDdl(true);
    adapter.setDatabasePlatform("org.hibernate.dialect.MySQL5InnoDBDialect");
    return adapter;
}
项目:restaurant    文件:RepositoryConfiguration.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
em.setDataSource(dataSource());
em.setPackagesToScan("org.restaurant.repository.model");

JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
em.setJpaVendorAdapter(vendorAdapter);
em.setJpaProperties(additionalProperties());

return em;
}
项目:enterprise    文件:InfrastructureConfig.java   
@Bean
public JpaVendorAdapter jpaVendorAdapter() {

    HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
    adapter.setDatabase(Database.MYSQL);
    adapter.setGenerateDdl(true);

    return adapter;
}
项目:enterprise    文件:InfrastructurConfig.java   
@Bean
public JpaVendorAdapter jpaVendorAdapter() {

    HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();
    adapter.setDatabase(Database.MYSQL);
    adapter.setGenerateDdl(true);

    return adapter;
}
项目:iws    文件:Beans.java   
@Bean(name = "entityManagerFactoryBean")
protected LocalContainerEntityManagerFactoryBean entityManagerFactoryBean() {
    final LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
    final JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();

    factoryBean.setPackagesToScan("net.iaeste.iws.persistence");
    factoryBean.setDataSource(dataSource());
    factoryBean.setJpaVendorAdapter(vendorAdapter);
    factoryBean.setJpaProperties(jpaProperties());

    return factoryBean;
}
项目:iws    文件:SpringConfig.java   
@Bean
protected LocalContainerEntityManagerFactoryBean entityManagerFactoryBean() {
    final LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();
    final JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();

    factoryBean.setPackagesToScan("net.iaeste.iws.persistence");
    factoryBean.setDataSource(dataSource());
    factoryBean.setJpaVendorAdapter(vendorAdapter);
    factoryBean.setJpaProperties(jpaProperties());

    return factoryBean;
}
项目:comics-blog    文件:PersistenceJPAConfiguration.java   
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
    LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setDataSource(dataSource());
    em.setPackagesToScan("org.demis.comics.data.jpa.entity");

    JpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    em.setJpaVendorAdapter(vendorAdapter);
    em.setJpaProperties(additionalProperties());

    return em;
}