当前位置: 首页>>代码示例>>Java>>正文


Java PostgreSQL9Dialect类代码示例

本文整理汇总了Java中org.hibernate.dialect.PostgreSQL9Dialect的典型用法代码示例。如果您正苦于以下问题:Java PostgreSQL9Dialect类的具体用法?Java PostgreSQL9Dialect怎么用?Java PostgreSQL9Dialect使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PostgreSQL9Dialect类属于org.hibernate.dialect包,在下文中一共展示了PostgreSQL9Dialect类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldGenerateSchemaFromDatabaseWithUpdateWithPostgresDialect

import org.hibernate.dialect.PostgreSQL9Dialect; //导入依赖的package包/类
@Test
public void shouldGenerateSchemaFromDatabaseWithUpdateWithPostgresDialect() throws Exception {
	// given
	File outputPath = tempFolder.newFolder();
	Properties jpaProperties = new Properties();
	jpaProperties.setProperty("hibernate.dialect", PostgreSQL9Dialect.class.getCanonicalName());

	SchemaGenerator schemaGenerator = new SchemaGenerator();

	// when
	schemaGenerator.generate(new GeneratorSettings(GenerationMode.DATABASE, outputPath,
			Arrays.asList("com.devskiller.jpa2ddl.sample"), Action.UPDATE, jpaProperties, true, ";", false));

	// then
	String sql = new String(Files.readAllBytes(outputPath.toPath().resolve("v1__jpa2ddl.sql")));
	assertThat(sql).contains("create table User");
	assertThat(sql).doesNotContain("drop table User");
}
 
开发者ID:Devskiller,项目名称:jpa2ddl,代码行数:19,代码来源:DatabaseSchemaUpdateTest.java

示例2: getHibernateDialect

import org.hibernate.dialect.PostgreSQL9Dialect; //导入依赖的package包/类
private Class<? extends Dialect> getHibernateDialect(final PersistenceUnitContext context) {
    final ConnectionDialect dialect = context.getConnectionDialect();
    switch (dialect) {
    case MSSQLSERVER:
        return SQLServerDialect.class;
    case MYSQL:
        return MySQL5InnoDBDialect.class;
    case POSTGRESQL:
        return PostgreSQL9Dialect.class;
    case ORACLE:
        return Oracle10gDialect.class;
    case H2:
        return H2Dialect.class;
    default:
        throw UnknownArgumentException.newInstance(ConnectionDialect.class, dialect);
    }
}
 
开发者ID:subes,项目名称:invesdwin-context-persistence,代码行数:18,代码来源:HibernateDialectSpecificDelegate.java

示例3: additionalProperties

import org.hibernate.dialect.PostgreSQL9Dialect; //导入依赖的package包/类
private Properties additionalProperties() {
	String dialect;

	switch (dbType) {
	case "postgres":
		dialect = PostgreSQL9Dialect.class.getName();
		break;
	case "mysql":
		dialect = MySQL5InnoDBDialect.class.getName();
		break;
	default:
		throw new IllegalArgumentException(dbType + " not recognized");
	}

	log.debug("Setting hibernate dialect {}", dialect);

	Properties properties = new Properties();
	properties.setProperty("hibernate.hbm2ddl.auto", "create-drop");
	properties.setProperty("hibernate.dialect", dialect);
	properties.setProperty("hibernate.show_sql", "false");
	return properties;
}
 
开发者ID:BlueWizardHat,项目名称:2fa-demo,代码行数:23,代码来源:PersistenceJpaConfig.java

示例4: checkEntityManagerFactoryConfiguration

import org.hibernate.dialect.PostgreSQL9Dialect; //导入依赖的package包/类
public static void checkEntityManagerFactoryConfiguration(EntityManagerFactory entityManagerFactory) {
    try {
        SessionFactoryImpl sessionFactoryImpl = entityManagerFactory.unwrap(SessionFactoryImpl.class);
        if (PostgreSQL9Dialect.class
            .isInstance(sessionFactoryImpl.getServiceRegistry().getService(JdbcServices.class).getDialect())) {
            //fix ClassLeftUnique and ClassRightUnique, as PostgreSQL cannot evaluate them on statement level
            modifyConstraints(sessionFactoryImpl);
        }
    } catch (PersistenceException e) {
        LogManager.getLogger()
            .warn("Unsupported EntityManagerFactory found: {}", entityManagerFactory.getClass().getName());
    }
}
 
开发者ID:MyCoRe-Org,项目名称:mycore,代码行数:14,代码来源:MCRHibernateConfigHelper.java

示例5: entityManagerFactory

import org.hibernate.dialect.PostgreSQL9Dialect; //导入依赖的package包/类
@Bean
    public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
        HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
        vendorAdapter.setDatabase(Database.POSTGRESQL);
        vendorAdapter.setGenerateDdl(true);

        LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
        factory.setJpaVendorAdapter(vendorAdapter);
        factory.setPackagesToScan("hu.cherubits.wonderjam.entities");
        factory.setDataSource(dataSource());
        factory.getJpaPropertyMap().put("hibernate.dialect", PostgreSQL9Dialect.class.getCanonicalName());
//        factory.getJpaPropertyMap().put("spring.jpa.hibernate.ddl-auto", "create");

        return factory;
    }
 
开发者ID:lordoftheflies,项目名称:wonderjameeee,代码行数:16,代码来源:DatabaseConfiguration.java

示例6: customEntityManagerFactory

import org.hibernate.dialect.PostgreSQL9Dialect; //导入依赖的package包/类
public
@Bean
EntityManagerFactory customEntityManagerFactory(DataSource dataSource) {
    HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
    vendorAdapter.setGenerateDdl(false); // turn off with Discriminator strategy so far!
    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setJpaVendorAdapter(vendorAdapter);
    factory.setPackagesToScan(TenancySampleApplication.class.getPackage().getName());
    factory.setDataSource(dataSource);
    factory.getJpaPropertyMap().put(Environment.DIALECT, PostgreSQL9Dialect.class.getName());
    factory.getJpaPropertyMap().put(Environment.MULTI_TENANT, MultiTenancyStrategy.DISCRIMINATOR);
    factory.getJpaPropertyMap().put(Environment.MULTI_TENANT_IDENTIFIER_RESOLVER, new TenantHolder());
    factory.afterPropertiesSet();
    return factory.getObject();
}
 
开发者ID:spring-labs,项目名称:tenancy-sample,代码行数:16,代码来源:TenancySampleApplication.java

示例7: setUp

import org.hibernate.dialect.PostgreSQL9Dialect; //导入依赖的package包/类
@Before
public void setUp() throws Exception {
	entityManagerFactory = Persistence.createEntityManagerFactory("sequence");
	conventions = DDLConventions.create(entityManagerFactory, new PostgreSQL9Dialect() {

		@Override
		public String getQuerySequencesString() {
			return null;
		}

	});
}
 
开发者ID:andreluiznsilva,项目名称:hibernate-conventions,代码行数:13,代码来源:DDLConventionsForPostgreSQL9DialectIT.java

示例8: addDialects

import org.hibernate.dialect.PostgreSQL9Dialect; //导入依赖的package包/类
private void addDialects(StrategySelectorImpl strategySelector) {
	addDialect( strategySelector, Cache71Dialect.class );
	addDialect( strategySelector, CUBRIDDialect.class );
	addDialect( strategySelector, DB2Dialect.class );
	addDialect( strategySelector, DB2390Dialect.class );
	addDialect( strategySelector, DB2400Dialect.class );
	addDialect( strategySelector, DerbyTenFiveDialect.class );
	addDialect( strategySelector, DerbyTenSixDialect.class );
	addDialect( strategySelector, DerbyTenSevenDialect.class );
	addDialect( strategySelector, FirebirdDialect.class );
	addDialect( strategySelector, FrontBaseDialect.class );
	addDialect( strategySelector, H2Dialect.class );
	addDialect( strategySelector, HSQLDialect.class );
	addDialect( strategySelector, InformixDialect.class );
	addDialect( strategySelector, IngresDialect.class );
	addDialect( strategySelector, Ingres9Dialect.class );
	addDialect( strategySelector, Ingres10Dialect.class );
	addDialect( strategySelector, InterbaseDialect.class );
	addDialect( strategySelector, JDataStoreDialect.class );
	addDialect( strategySelector, MckoiDialect.class );
	addDialect( strategySelector, MimerSQLDialect.class );
	addDialect( strategySelector, MySQL5Dialect.class );
	addDialect( strategySelector, MySQL5InnoDBDialect.class );
	addDialect( strategySelector, MySQL5Dialect.class );
	addDialect( strategySelector, MySQL5InnoDBDialect.class );
	addDialect( strategySelector, Oracle8iDialect.class );
	addDialect( strategySelector, Oracle9iDialect.class );
	addDialect( strategySelector, Oracle10gDialect.class );
	addDialect( strategySelector, PointbaseDialect.class );
	addDialect( strategySelector, PostgresPlusDialect.class );
	addDialect( strategySelector, PostgreSQL81Dialect.class );
	addDialect( strategySelector, PostgreSQL82Dialect.class );
	addDialect( strategySelector, PostgreSQL9Dialect.class );
	addDialect( strategySelector, ProgressDialect.class );
	addDialect( strategySelector, SAPDBDialect.class );
	addDialect( strategySelector, SQLServerDialect.class );
	addDialect( strategySelector, SQLServer2005Dialect.class );
	addDialect( strategySelector, SQLServer2008Dialect.class );
	addDialect( strategySelector, Sybase11Dialect.class );
	addDialect( strategySelector, SybaseAnywhereDialect.class );
	addDialect( strategySelector, SybaseASE15Dialect.class );
	addDialect( strategySelector, SybaseASE157Dialect.class );
	addDialect( strategySelector, TeradataDialect.class );
	addDialect( strategySelector, TimesTenDialect.class );
}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:46,代码来源:StrategySelectorBuilder.java

示例9: hibernateDialect

import org.hibernate.dialect.PostgreSQL9Dialect; //导入依赖的package包/类
@Override
public String hibernateDialect() {
    return PostgreSQL9Dialect.class.getName();
}
 
开发者ID:vladmihalcea,项目名称:hibernate-types,代码行数:5,代码来源:PostgreSQLDataSourceProvider.java


注:本文中的org.hibernate.dialect.PostgreSQL9Dialect类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。