Search in sources :

Example 6 with JPAVendorAdapter

use of org.wso2.carbon.bpel.b4p.coordination.dao.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));
}
Also used : JPAVendorAdapter(org.wso2.carbon.attachment.mgt.core.dao.impl.jpa.JPAVendorAdapter)

Example 7 with JPAVendorAdapter

use of org.wso2.carbon.bpel.b4p.coordination.dao.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;
}
Also used : JPAVendorAdapter(org.wso2.carbon.humantask.core.dao.jpa.JPAVendorAdapter)

Example 8 with JPAVendorAdapter

use of org.wso2.carbon.bpel.b4p.coordination.dao.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));
}
Also used : JPAVendorAdapter(org.wso2.carbon.humantask.core.dao.jpa.JPAVendorAdapter)

Aggregations

JPAVendorAdapter (org.wso2.carbon.bpel.b4p.coordination.dao.jpa.JPAVendorAdapter)4 JPAVendorAdapter (org.wso2.carbon.attachment.mgt.core.dao.impl.jpa.JPAVendorAdapter)2 JPAVendorAdapter (org.wso2.carbon.humantask.core.dao.jpa.JPAVendorAdapter)2 Ejb3Configuration (org.hibernate.ejb.Ejb3Configuration)1