use of org.wso2.carbon.attachment.mgt.core.dao.impl.jpa.JPAVendorAdapter in project carbon-business-process by wso2.
the class AttachmentMgtDAOConnectionFactoryImpl method init.
@Override
public void init() {
if (transactionManager == null) {
log.debug("Transaction-Manager is not initialized before initializing entityManager. So internal " + "transaction-manager in entity manager will be used.");
}
JPAVendorAdapter vendorAdapter = getJPAVendorAdapter();
// Here we pass a "null" valued transaction manager,
// as we enforce the entity-manager-factory to use its local transactions. In future,
// if required to use external JTA transactions, a transaction reference should be passed
// as the input parameter.
this.entityManagerFactory = Persistence.createEntityManagerFactory("Attachment-Mgt-PU", vendorAdapter.getJpaPropertyMap(null));
}
use of org.wso2.carbon.attachment.mgt.core.dao.impl.jpa.JPAVendorAdapter in project carbon-business-process by wso2.
the class HumanTaskDAOConnectionFactoryImpl method getJPAVendorAdapter.
/**
* Returns the JPA Vendor adapter based on user preference
* <p/>
* Note: Currently we only support one JPA vendor(OpenJPA), so I have omitted vendor selection
* logic.
*
* @return JPAVendorAdapter implementation
*/
private JPAVendorAdapter getJPAVendorAdapter() {
JPAVendorAdapter vendorAdapter = new OpenJPAVendorAdapter();
vendorAdapter.setDataSource(dataSource);
// TODO: Investigate whether this could be moved to upper layer. Directly put bool into prop map.
Object generateDDL = jpaPropertiesMap.get(Constants.PROP_ENABLE_DDL_GENERATION);
Object showSQL = jpaPropertiesMap.get(Constants.PROP_ENABLE_SQL_TRACING);
if (generateDDL == null) {
generateDDL = Boolean.FALSE.toString();
}
if (showSQL == null) {
showSQL = Boolean.FALSE.toString();
}
vendorAdapter.setGenerateDdl((Boolean) generateDDL);
vendorAdapter.setShowSql((Boolean) showSQL);
return vendorAdapter;
}
use of org.wso2.carbon.attachment.mgt.core.dao.impl.jpa.JPAVendorAdapter in project carbon-business-process by wso2.
the class HumanTaskDAOConnectionFactoryImpl method init.
public void init() {
JPAVendorAdapter vendorAdapter = getJPAVendorAdapter();
this.entityManagerFactory = Persistence.createEntityManagerFactory("HT-PU", vendorAdapter.getJpaPropertyMap(tnxManager));
}
Aggregations