本文整理汇总了Java中org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter.setShowSql方法的典型用法代码示例。如果您正苦于以下问题:Java EclipseLinkJpaVendorAdapter.setShowSql方法的具体用法?Java EclipseLinkJpaVendorAdapter.setShowSql怎么用?Java EclipseLinkJpaVendorAdapter.setShowSql使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter
的用法示例。
在下文中一共展示了EclipseLinkJpaVendorAdapter.setShowSql方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: entityManagerFactory
import org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter; //导入方法依赖的package包/类
/**
* JPA entity manager factory bean.
* Depends on the hsqlDbServer bean, in order to create the embedded
* database, if one is to be used, before the entity manager factory.
*/
@Bean
@DependsOn("hsqlDbServer")
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
/* JPA entity manager factory. */
final LocalContainerEntityManagerFactoryBean theJpaEntityManagerFactory =
new LocalContainerEntityManagerFactoryBean();
theJpaEntityManagerFactory.setDataSource(dataSource());
theJpaEntityManagerFactory.setPersistenceUnitName("message-cowboy");
theJpaEntityManagerFactory.setJpaProperties(jpaProperties());
/* JPA vendor adapter. */
final EclipseLinkJpaVendorAdapter theJpaVendorAdapter =
new EclipseLinkJpaVendorAdapter();
theJpaVendorAdapter.setShowSql(true);
theJpaEntityManagerFactory.setJpaVendorAdapter(theJpaVendorAdapter);
return theJpaEntityManagerFactory;
}
示例2: entityManagerFactory
import org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter; //导入方法依赖的package包/类
/**
* JPA entity manager factory bean.
*/
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
/* JPA entity manager factory. */
final LocalContainerEntityManagerFactoryBean theJpaEntityManagerFactory =
new LocalContainerEntityManagerFactoryBean();
theJpaEntityManagerFactory.setDataSource(dataSource());
theJpaEntityManagerFactory.setPersistenceUnitName("message-cowboy");
theJpaEntityManagerFactory.setJpaProperties(jpaProperties());
/* JPA vendor adapter. */
final EclipseLinkJpaVendorAdapter theJpaVendorAdapter =
new EclipseLinkJpaVendorAdapter();
theJpaVendorAdapter.setShowSql(true);
theJpaEntityManagerFactory.setJpaVendorAdapter(theJpaVendorAdapter);
return theJpaEntityManagerFactory;
}
示例3: 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;
}
示例4: 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;
}
示例5: entityManagerFactory
import org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
public FactoryBean<EntityManagerFactory> entityManagerFactory() {
LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
emf.setDataSource(dataSource());
EclipseLinkJpaVendorAdapter va = new EclipseLinkJpaVendorAdapter();
va.setShowSql(true);
emf.setJpaVendorAdapter(va);
emf.setPackagesToScan(TestJpaDomain.class.getPackage().getName());
emf.setPersistenceUnitName("test");
emf.getJpaPropertyMap().put("eclipselink.weaving", "false");
return emf;
}
示例6: 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;
}
示例7: createJpaVendorAdapter
import org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter; //导入方法依赖的package包/类
@Override
protected AbstractJpaVendorAdapter createJpaVendorAdapter() {
LOGGER.info("PersistenceConfiguration.createJpaVendorAdapter()");
EclipseLinkJpaVendorAdapter jpaVendorAdapter = new EclipseLinkJpaVendorAdapter();
jpaVendorAdapter.setShowSql(true);
return jpaVendorAdapter;
}
示例8: jpaAdapter
import org.springframework.orm.jpa.vendor.EclipseLinkJpaVendorAdapter; //导入方法依赖的package包/类
@Bean
public JpaVendorAdapter jpaAdapter() {
EclipseLinkJpaVendorAdapter eclipseLinkJpaVendorAdapter = new EclipseLinkJpaVendorAdapter();
eclipseLinkJpaVendorAdapter.setShowSql(true);
eclipseLinkJpaVendorAdapter.setDatabase(Database.H2);
return eclipseLinkJpaVendorAdapter;
}