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

项目: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();
}
项目:BCDS    文件:DatabaseConfiguration.java   
@Bean
@Autowired
public JpaTransactionManager transactionManager(EntityManagerFactory entityManagerFactory) {
    JpaTransactionManager txManager = new JpaTransactionManager();
    JpaDialect jpaDialect = new HibernateJpaDialect();
    txManager.setEntityManagerFactory(entityManagerFactory);
    txManager.setJpaDialect(jpaDialect);
    return txManager;
}
项目:invesdwin-context-persistence    文件:PersistenceUnitContext.java   
private PlatformTransactionManager createTransactionManager() {
    final JpaTransactionManager jpaTransactionManager = new JpaTransactionManager();
    jpaTransactionManager.setEntityManagerFactory(getEntityManagerFactory());
    final JpaDialect jpaDialect = getJpaDialect();
    if (jpaDialect != null) {
        jpaTransactionManager.setJpaDialect(jpaDialect);
    }
    final LoggingDelegateTransactionManager loggingDelegateTransactionManager = new LoggingDelegateTransactionManager(
            this, jpaTransactionManager);
    final String transactionManagerBeanName = getPersistenceUnitName()
            + PersistenceProperties.TRANSACTION_MANAGER_NAME_SUFFIX;
    MergedContext.getInstance().registerBean(transactionManagerBeanName, loggingDelegateTransactionManager);
    Assertions.assertThat(MergedContext.getInstance().getBean(transactionManagerBeanName)).isNotNull();
    return loggingDelegateTransactionManager;
}
项目:spring-agora-web    文件:ApplicationConfig.java   
@Bean
@Autowired
public JpaTransactionManager transactionManager(EntityManagerFactory entityManagerFactory) 
{
    JpaDialect jpaDialect = new HibernateJpaDialect();

    JpaTransactionManager txManager = new JpaTransactionManager();
    txManager.setEntityManagerFactory(entityManagerFactory);
    txManager.setJpaDialect(jpaDialect);

    return txManager; 
}
项目:class-guard    文件:SharedEntityManagerBean.java   
public final void afterPropertiesSet() {
    EntityManagerFactory emf = getEntityManagerFactory();
    if (emf == null) {
        throw new IllegalArgumentException("'entityManagerFactory' or 'persistenceUnitName' is required");
    }
    Class[] ifcs = null;
    if (emf instanceof EntityManagerFactoryInfo) {
        EntityManagerFactoryInfo emfInfo = (EntityManagerFactoryInfo) emf;
        if (this.entityManagerInterface == null) {
            this.entityManagerInterface = emfInfo.getEntityManagerInterface();
            if (this.entityManagerInterface == null) {
                this.entityManagerInterface = EntityManager.class;
            }
        }
        JpaDialect jpaDialect = emfInfo.getJpaDialect();
        if (jpaDialect != null && jpaDialect.supportsEntityManagerPlusOperations()) {
            ifcs = new Class[] {this.entityManagerInterface, EntityManagerPlus.class};
        }
        else {
            ifcs = new Class[] {this.entityManagerInterface};
        }
    }
    else {
        if (this.entityManagerInterface == null) {
            this.entityManagerInterface = EntityManager.class;
        }
        ifcs = new Class[] {this.entityManagerInterface};
    }
    this.shared = SharedEntityManagerCreator.createSharedEntityManager(emf, getJpaPropertyMap(), ifcs);
}
项目:jsf-exmple    文件:PersistenceConfig.java   
@Bean
@Autowired
public JpaTransactionManager transactionManager(EntityManagerFactory emf,
        JpaDialect dialect) {

    JpaTransactionManager txManager = new JpaTransactionManager();
    txManager.setEntityManagerFactory(emf);
    txManager.setJpaDialect(dialect);
    return txManager;
}
项目:lams    文件:HibernateJpaVendorAdapter.java   
@Override
public JpaDialect getJpaDialect() {
    return this.jpaDialect;
}
项目:lams    文件:EclipseLinkJpaVendorAdapter.java   
@Override
public JpaDialect getJpaDialect() {
    return this.jpaDialect;
}
项目:lams    文件:AbstractJpaVendorAdapter.java   
@Override
public JpaDialect getJpaDialect() {
    return null;
}
项目:lams    文件:OpenJpaVendorAdapter.java   
@Override
public JpaDialect getJpaDialect() {
    return this.jpaDialect;
}
项目:spring4-understanding    文件:AbstractJpaVendorAdapter.java   
@Override
public JpaDialect getJpaDialect() {
    return null;
}
项目:springJpaKata    文件:JpaConfig.java   
public JpaDialect customJpaDialect() {
    return new CustomHibernateJpaDialect();
}
项目:invesdwin-context-persistence    文件:DatanucleusDialectSpecificDelegate.java   
@Override
public JpaDialect getJpaDialect(final PersistenceUnitContext persistenceUnitContext) {
    return null;
}
项目:invesdwin-context-persistence    文件:PersistenceUnitContext.java   
private JpaDialect getJpaDialect() {
    return persistenceUnitContextManager.getDialectSpecificDelegate(getConnectionDialect()).getJpaDialect(this);
}
项目:invesdwin-context-persistence    文件:KunderaRdbmsDialectSpecificDelegate.java   
@Override
public JpaDialect getJpaDialect(final PersistenceUnitContext persistenceUnitContext) {
    return null;
}
项目:invesdwin-context-persistence    文件:HibernateDialectSpecificDelegate.java   
@Override
public JpaDialect getJpaDialect(final PersistenceUnitContext persistenceUnitContext) {
    return new HibernateExtendedJpaDialect();
}
项目:xap-openspaces    文件:OpenSpacesJpaVendorAdapter.java   
public JpaDialect getJpaDialect() {
    return null;
}
项目:opencucina    文件:HsqlDb.java   
/**
 * Initializes the hypersonic db.
 */
public synchronized void init(String... packagesToScan) {
    if (ArrayUtils.isEmpty(packagesToScan)) {
        throw new RuntimeException("Package names to scan must be provided as arg");
    }

    if (isInitialized()) {
        //If already initialized just return cleanly
        return;
    }

    try {
        dataSource = new BasicDataSource();
        dataSource.setDriverClassName("org.hsqldb.jdbcDriver");
        dataSource.setUrl("jdbc:hsqldb:mem:sprite");
        dataSource.setUsername("sa");
        dataSource.setPassword("");

        JpaDialect dialect = new HibernateJpaDialect();
        LocalContainerEntityManagerFactoryBean localEMFactory = new LocalContainerEntityManagerFactoryBean();

        localEMFactory.setJpaDialect(dialect);
        localEMFactory.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
        localEMFactory.setDataSource(dataSource);
        localEMFactory.setPackagesToScan(packagesToScan);

        //localEMFactory.setLoadTimeWeaver(new InstrumentationLoadTimeWeaver());
        Map<String, Object> properties = new HashMap<String, Object>();

        properties.put("eclipselink.logging.level", "FINE");
        properties.put("eclipselink.logging.level.sql", "FINE");
        properties.put("hibernate.hbm2ddl.auto", "create-drop");
        properties.put("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
        properties.put("PersistenceVersion", "2.1");
        localEMFactory.setJpaPropertyMap(properties);

        localEMFactory.afterPropertiesSet();

        entityManagerFactory = localEMFactory.getObject();
        jdbcTemplate = new JdbcTemplate(dataSource);

        transactionManager = new JpaTransactionManager();
        transactionManager.setJpaDialect(dialect);
        transactionManager.setEntityManagerFactory(entityManagerFactory);
        transactionManager.setDataSource(dataSource);
    } catch (Exception ex) {
        ex.printStackTrace();
        fail("Failed to initialize entityManager: " + ex);
    }

    initialized = true;
}
项目:opencucina    文件:HsqlDb.java   
/**
 * Initializes the hypersonic db.
 */
public synchronized void init(String... packagesToScan) {
    if (ArrayUtils.isEmpty(packagesToScan)) {
        throw new RuntimeException("Package names to scan must be provided as arg");
    }

    if (isInitialized()) {
        //If already initialized just return cleanly
        return;
    }

    try {
        dataSource = new BasicDataSource();
        dataSource.setDriverClassName("org.hsqldb.jdbcDriver");
        dataSource.setUrl("jdbc:hsqldb:mem:sprite");
        dataSource.setUsername("sa");
        dataSource.setPassword("");

        JpaDialect dialect = new HibernateJpaDialect();
        LocalContainerEntityManagerFactoryBean localEMFactory = new LocalContainerEntityManagerFactoryBean();

        localEMFactory.setJpaDialect(dialect);
        localEMFactory.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
        localEMFactory.setDataSource(dataSource);
        localEMFactory.setPackagesToScan(packagesToScan);

        //localEMFactory.setLoadTimeWeaver(new InstrumentationLoadTimeWeaver());
        Map<String, Object> properties = new HashMap<String, Object>();

        properties.put("eclipselink.logging.level", "FINE");
        properties.put("eclipselink.logging.level.sql", "FINE");
        properties.put("hibernate.hbm2ddl.auto", "create-drop");
        properties.put("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
        properties.put("PersistenceVersion", "2.1");
        localEMFactory.setJpaPropertyMap(properties);

        localEMFactory.afterPropertiesSet();

        entityManagerFactory = localEMFactory.getObject();
        jdbcTemplate = new JdbcTemplate(dataSource);

        transactionManager = new JpaTransactionManager();
        transactionManager.setJpaDialect(dialect);
        transactionManager.setEntityManagerFactory(entityManagerFactory);
        transactionManager.setDataSource(dataSource);
    } catch (Exception ex) {
        ex.printStackTrace();
        fail("Failed to initialize entityManager: " + ex);
    }

    initialized = true;
}
项目:kc-rice    文件:KradEntityManagerFactoryBean.java   
/**
 * {@inheritDoc}
 */
@Override
public JpaDialect getJpaDialect() {
    return internalFactoryBean.getJpaDialect();
}
项目:spring-project-template    文件:AppConfig.java   
@Bean 
public JpaDialect jpaDialect() {
    return new HibernateJpaDialect();
}
项目:spring-project-template    文件:TestConfig.java   
@Bean
public JpaDialect jpaDialect() {
    return new HibernateJpaDialect();
}
项目:class-guard    文件:HibernateJpaVendorAdapter.java   
@Override
public JpaDialect getJpaDialect() {
    return this.jpaDialect;
}
项目:class-guard    文件:EclipseLinkJpaVendorAdapter.java   
@Override
public JpaDialect getJpaDialect() {
    return this.jpaDialect;
}
项目:class-guard    文件:AbstractJpaVendorAdapter.java   
public JpaDialect getJpaDialect() {
    return null;
}
项目:class-guard    文件:TopLinkJpaVendorAdapter.java   
@Override
public JpaDialect getJpaDialect() {
    return this.jpaDialect;
}
项目:class-guard    文件:OpenJpaVendorAdapter.java   
@Override
public JpaDialect getJpaDialect() {
    return this.jpaDialect;
}
项目:jsf-exmple    文件:PersistenceConfig.java   
@Bean
public JpaDialect jpaDialect() {
    return new HibernateJpaDialect();
}
项目:rice    文件:KradEntityManagerFactoryBean.java   
/**
 * {@inheritDoc}
 */
@Override
public JpaDialect getJpaDialect() {
    return internalFactoryBean.getJpaDialect();
}
项目:social-label-server    文件:AppConfig.java   
@Bean public JpaDialect jpaDialect() {
    return new HibernateJpaDialect();
}
项目:kuali_rice    文件:DevHibernateJpaVendorAdapter.java   
public JpaDialect getJpaDialect() {
    return this.jpaDialect;
}
项目:bjug-querydsl    文件:JpaConfig.java   
@Bean 
public JpaDialect jpaDialect() {
    return new HibernateJpaDialect();
}
项目:b4    文件:B4CoreRootConfig.java   
@Bean
public JpaDialect jpaDialect() {
    return new HibernateJpaDialect();
}
项目:OpERP    文件:JpaContext.java   
@Bean
public JpaDialect jpaDialect() {
    return new HibernateJpaDialect();
}
项目:OpERP    文件:JpaH2TestContext.java   
@Bean
public JpaDialect jpaDialect() {
    return new HibernateJpaDialect();
}
项目:OpERP    文件:JpaTestContext.java   
@Bean
public JpaDialect jpaDialect() {
    return new HibernateJpaDialect();
}
项目: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();
}
项目:invesdwin-context-persistence    文件:IPersistencePropertiesProvider.java   
/**
 * May return to null to stick with default.
 */
JpaDialect getJpaDialect(PersistenceUnitContext persistenceUnitContext);
项目:kc-rice    文件:KradEntityManagerFactoryBean.java   
/**
 * Specify the vendor-specific JpaDialect implementation to associate with this EntityManagerFactory.
 *
 * <p>
 * This will be exposed through the EntityManagerFactoryInfo interface, to be picked up as default dialect by
 * accessors that intend to use JpaDialect functionality.
 * </p>
 *
 * @param jpaDialect the JPA dialect to set
 *
 * @see EntityManagerFactoryInfo#getJpaDialect()
 */
public void setJpaDialect(JpaDialect jpaDialect) {
    this.internalFactoryBean.setJpaDialect(jpaDialect);
}
项目:rice    文件:KradEntityManagerFactoryBean.java   
/**
 * Specify the vendor-specific JpaDialect implementation to associate with this EntityManagerFactory.
 *
 * <p>
 * This will be exposed through the EntityManagerFactoryInfo interface, to be picked up as default dialect by
 * accessors that intend to use JpaDialect functionality.
 * </p>
 *
 * @param jpaDialect the JPA dialect to set
 *
 * @see EntityManagerFactoryInfo#getJpaDialect()
 */
public void setJpaDialect(JpaDialect jpaDialect) {
    this.internalFactoryBean.setJpaDialect(jpaDialect);
}