Java 类org.springframework.orm.jpa.vendor.EclipseLinkJpaDialect 实例源码

项目:esup-ecandidat    文件:JpaConfigEcandidat.java   
/**
 * @return EntityManager Factory
 */
@Bean(name = "entityManagerFactoryEcandidat")
public LocalContainerEntityManagerFactoryBean entityManagerFactoryEcandidat() {
    DataSource ds = dataSourceEcandidat();
    /* Si l'appli s'initialise, il faut lancer Flyway */
    /**
     * TODO:problème avec tomcat8 qui reinitialise les beans au shutdown et met
     * flyway en erreur
     */
    String init = System.getProperty(ConstanteUtils.STARTUP_INIT_FLYWAY);
    if (init == null || !init.equals(ConstanteUtils.STARTUP_INIT_FLYWAY_OK)) {
        initFlyway(ds);
        System.setProperty(ConstanteUtils.STARTUP_INIT_FLYWAY, ConstanteUtils.STARTUP_INIT_FLYWAY_OK);
    }

    LocalContainerEntityManagerFactoryBean localContainerEntityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
    localContainerEntityManagerFactoryBean.setPersistenceUnitName(PERSISTENCE_UNIT_NAME);
    localContainerEntityManagerFactoryBean.setPackagesToScan(Candidat.class.getPackage().getName(),
            LocalTimePersistenceConverter.class.getPackage().getName());
    localContainerEntityManagerFactoryBean.setDataSource(ds);
    localContainerEntityManagerFactoryBean.setJpaDialect(new EclipseLinkJpaDialect());

    Properties jpaProperties = new Properties();
    /* Active le static weaving d'EclipseLink */
    jpaProperties.put(PersistenceUnitProperties.WEAVING, "static");
    /* Désactive le cache partagé */
    jpaProperties.put(PersistenceUnitProperties.CACHE_SHARED_DEFAULT, String.valueOf(false));
    localContainerEntityManagerFactoryBean.setJpaProperties(jpaProperties);

    EclipseLinkJpaVendorAdapter jpaVendorAdapter = new EclipseLinkJpaVendorAdapter();
    jpaVendorAdapter.setGenerateDdl(false);
    jpaVendorAdapter.setShowSql(false);
    localContainerEntityManagerFactoryBean.setJpaVendorAdapter(jpaVendorAdapter);

    return localContainerEntityManagerFactoryBean;
}
项目:hawkbit    文件:RepositoryApplicationConfiguration.java   
@Override
protected AbstractJpaVendorAdapter createJpaVendorAdapter() {
    return new EclipseLinkJpaVendorAdapter() {
        private final HawkBitEclipseLinkJpaDialect jpaDialect = new HawkBitEclipseLinkJpaDialect();

        @Override
        public EclipseLinkJpaDialect getJpaDialect() {
            return jpaDialect;
        }
    };
}
项目:cuba    文件:CubaEclipseLinkJpaVendorAdapter.java   
@Override
public EclipseLinkJpaDialect getJpaDialect() {
    return jpaDialect;
}
项目:ru.wrom.darts.statistic    文件:SpringConfig.java   
@Bean
public EclipseLinkJpaDialect eclipseLinkJpaDialect() {
    return new EclipseLinkJpaDialect();
}
项目:REST-Web-Services    文件:WebDatasourceConfig.java   
/**
 * SPI strategy that encapsulates certain functionality that standard JPA 2.1 does not offer,
 * such as access to the underlying JDBC Connection.
 * This strategy is mainly intended for standalone usage of a JPA provider.
 */
@Bean
public JpaDialect jpaDialect() {
    return new EclipseLinkJpaDialect();
}