本文整理汇总了Java中org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter.setGenerateDdl方法的典型用法代码示例。如果您正苦于以下问题:Java EclipseLinkJpaVendorAdapter.setGenerateDdl方法的具体用法?Java EclipseLinkJpaVendorAdapter.setGenerateDdl怎么用?Java EclipseLinkJpaVendorAdapter.setGenerateDdl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter
的用法示例。
在下文中一共展示了EclipseLinkJpaVendorAdapter.setGenerateDdl方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getEclipseLinkJpaVendorAdapter
import org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter; //导入方法依赖的package包/类
/**
* Exposes EclipseLink's persistence provider and EntityManager extension interface,
* and adapts AbstractJpaVendorAdapter's common configuration settings.
*/
@Bean
public EclipseLinkJpaVendorAdapter getEclipseLinkJpaVendorAdapter() {
final EclipseLinkJpaVendorAdapter vendorAdapter = new EclipseLinkJpaVendorAdapter();
vendorAdapter.setDatabasePlatform(eclipseLinkProperties.getDatabasePlatform());
vendorAdapter.setGenerateDdl(eclipseLinkProperties.isGenerateDll());
vendorAdapter.setShowSql(eclipseLinkProperties.isShowSql());
return vendorAdapter;
}
示例2: entityManagerFactoryEcandidat
import org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter; //导入方法依赖的package包/类
/**
* @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;
}
示例3: jpaVendorAdapter
import org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
protected EclipseLinkJpaVendorAdapter jpaVendorAdapter() {
EclipseLinkJpaVendorAdapter adapter = new EclipseLinkJpaVendorAdapter();
adapter.setDatabase(Database.MYSQL);
adapter.setShowSql(true);
adapter.setGenerateDdl(false);
return adapter;
}
示例4: entityManagerFactory
import org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
final EclipseLinkJpaVendorAdapter vendorAdapter = new EclipseLinkJpaVendorAdapter();
vendorAdapter.setDatabase(Database.DERBY);
vendorAdapter.setGenerateDdl(true);
final LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
factory.setJpaVendorAdapter(vendorAdapter);
factory.setPackagesToScan(getClass().getPackage().getName());
factory.setDataSource(dataSource());
return factory;
}