本文整理汇总了Java中org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor类的典型用法代码示例。如果您正苦于以下问题:Java PersistenceUnitPostProcessor类的具体用法?Java PersistenceUnitPostProcessor怎么用?Java PersistenceUnitPostProcessor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PersistenceUnitPostProcessor类属于org.springframework.orm.jpa.persistenceunit包,在下文中一共展示了PersistenceUnitPostProcessor类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: KradEntityManagerFactoryBean
import org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor; //导入依赖的package包/类
/**
* Creates a default KRAD-managed factory bean.
*/
public KradEntityManagerFactoryBean() throws Exception {
this.persistenceUnitPostProcessors = new ArrayList<PersistenceUnitPostProcessor>();
this.managedClassNames = new ArrayList<String>();
this.converterPackageNames = new ArrayList<String>();
converterPackageNames.add(DEFAULT_CONVERTERS_PACKAGE); // set as default
this.persistenceUnitManager = createPersistenceUnitManager();
this.internalFactoryBean = createInternalFactoryBean(this.persistenceUnitManager);
this.internalFactoryBean.setJpaPropertyMap(createDefaultJpaProperties());
final Object jpaVendorAdapterClass = getJpaPropertyMap().get(JPA_VENDOR_ADAPTER_CLASS);
if (jpaVendorAdapterClass != null) {
setJpaVendorAdapter((JpaVendorAdapter) Class.forName((String) jpaVendorAdapterClass).newInstance());
}
}
示例2: KradEntityManagerFactoryBean
import org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor; //导入依赖的package包/类
/**
* Creates a default KRAD-managed factory bean.
*/
public KradEntityManagerFactoryBean() {
this.persistenceUnitPostProcessors = new ArrayList<PersistenceUnitPostProcessor>();
this.managedClassNames = new ArrayList<String>();
this.converterPackageNames = new ArrayList<String>();
converterPackageNames.add(DEFAULT_CONVERTERS_PACKAGE); // set as default
this.persistenceUnitManager = createPersistenceUnitManager();
this.internalFactoryBean = createInternalFactoryBean(this.persistenceUnitManager);
this.internalFactoryBean.setJpaPropertyMap(createDefaultJpaProperties());
}
示例3: assemblePersistenceUnitPostProcessors
import org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor; //导入依赖的package包/类
/**
* Assembles the {@link PersistenceUnitPostProcessor}s into an array.
*
* @return an array of the {@link PersistenceUnitPostProcessor}s.
*/
protected PersistenceUnitPostProcessor[] assemblePersistenceUnitPostProcessors() {
this.persistenceUnitPostProcessors = new ArrayList<PersistenceUnitPostProcessor>(this.persistenceUnitPostProcessors);
this.persistenceUnitPostProcessors.add(new InternalPersistenceUnitPostProcessor());
return this.persistenceUnitPostProcessors.toArray(new PersistenceUnitPostProcessor[this.persistenceUnitPostProcessors.size()]);
}
示例4: getPersistenceUnitPostProcessors
import org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor; //导入依赖的package包/类
public PersistenceUnitPostProcessor[] getPersistenceUnitPostProcessors() {
return postProcessors;
}
示例5: setPersistenceUnitPostProcessors
import org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor; //导入依赖的package包/类
public void setPersistenceUnitPostProcessors(final PersistenceUnitPostProcessor... postProcessors) {
this.postProcessors = postProcessors;
}
示例6: setPersistenceUnitPostProcessors
import org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor; //导入依赖的package包/类
/**
* Set the PersistenceUnitPostProcessors to be applied to the
* PersistenceUnitInfo used for creating this EntityManagerFactory.
* <p>Such post-processors can, for example, register further entity
* classes and jar files, in addition to the metadata read from
* {@code persistence.xml}.
* <p><b>NOTE: Only applied if no external PersistenceUnitManager specified.</b>
* @see #setPersistenceUnitManager
*/
public void setPersistenceUnitPostProcessors(PersistenceUnitPostProcessor... postProcessors) {
this.internalPersistenceUnitManager.setPersistenceUnitPostProcessors(postProcessors);
}
示例7: getPersistenceUnitPostProcessors
import org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor; //导入依赖的package包/类
/**
* Returns an array of the {@link PersistenceUnitPostProcessor} instances which have been configured on this
* factory bean.
*
* @return array of post processors, may be empty but will never return null
*/
public PersistenceUnitPostProcessor[] getPersistenceUnitPostProcessors() {
return persistenceUnitPostProcessors.toArray(new PersistenceUnitPostProcessor[persistenceUnitPostProcessors.size()]);
}
示例8: setPersistenceUnitPostProcessors
import org.springframework.orm.jpa.persistenceunit.PersistenceUnitPostProcessor; //导入依赖的package包/类
/**
* Set the PersistenceUnitPostProcessors to be applied to the * PersistenceUnitInfo used for creating this
* EntityManagerFactory.
*
* <p>
* Note that if executed before {@link #afterPropertiesSet()} then this factory bean may introduce its own post
* processor instances. If invoked after, then this method will override internally configured post processors.
* </p>
*
* <p>
* Such post-processors can, for example, register further entity classes and jar files, in addition to the metadata
* read from {@code persistence.xml}.
* </p>
*
* @param postProcessors one or more post processors to set
*/
public void setPersistenceUnitPostProcessors(PersistenceUnitPostProcessor... postProcessors) {
// persistence unit post processors will get applied to the internal factory bean during afterPropertiesSet(),
// this allows us to add our own internal post processor to the list)
this.persistenceUnitPostProcessors = new ArrayList<PersistenceUnitPostProcessor>(Arrays.asList(postProcessors));
}