Search in sources :

Example 1 with PersistenceDescriptor

use of org.jboss.shrinkwrap.descriptor.api.persistence20.PersistenceDescriptor in project hibernate-orm by hibernate.

the class DdlInWildFlyUsingBmtAndEmfTest method persistenceXml.

private static PersistenceDescriptor persistenceXml() {
    final PersistenceDescriptor pd = Descriptors.create(PersistenceDescriptor.class).version("2.1").createPersistenceUnit().name(PERSISTENCE_UNIT_NAME).transactionType(PersistenceUnitTransactionType._JTA).jtaDataSource("java:jboss/datasources/ExampleDS").clazz(WildFlyDdlEntity.class.getName()).excludeUnlistedClasses(true).getOrCreateProperties().createProperty().name("jboss.as.jpa.providerModule").value("org.hibernate:5.2").up().up().getOrCreateProperties().createProperty().name("hibernate.hbm2ddl.auto").value("create-drop").up().up().getOrCreateProperties().createProperty().name(AvailableSettings.JTA_PLATFORM).value(JBossAppServerJtaPlatform.class.getName()).up().up().up();
    System.out.println("persistence.xml: ");
    pd.exportTo(System.out);
    return pd;
}
Also used : PersistenceDescriptor(org.jboss.shrinkwrap.descriptor.api.persistence21.PersistenceDescriptor) WildFlyDdlEntity(org.hibernate.test.wf.ddl.WildFlyDdlEntity)

Example 2 with PersistenceDescriptor

use of org.jboss.shrinkwrap.descriptor.api.persistence20.PersistenceDescriptor in project tomee by apache.

the class JPAInjectionTest method getArchive.

@Deployment(testable = false)
public static WebArchive getArchive() {
    PersistenceDescriptor persistenceDescriptor = Descriptors.create(PersistenceDescriptor.class).createPersistenceUnit().name("test-pu").transactionType("JTA").clazz(PersistenceDescriptor.class.getName()).jtaDataSource("test-ds").up();
    Asset persistenceAsset = new StringAsset(persistenceDescriptor.exportAsString());
    return base("jsf-jpa-test.war").addAsWebInfResource(persistenceAsset, "persistence.xml").addClasses(DummyManagedBean.class).addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml").addAsWebResource(new ClassLoaderAsset(JPAInjectionTest.class.getPackage().getName().replace('.', '/').concat("/").concat("dummy.xhtml")), "dummy.xhtml");
}
Also used : PersistenceDescriptor(org.jboss.shrinkwrap.descriptor.api.persistence20.PersistenceDescriptor) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) EmptyAsset(org.jboss.shrinkwrap.api.asset.EmptyAsset) StringAsset(org.jboss.shrinkwrap.api.asset.StringAsset) Asset(org.jboss.shrinkwrap.api.asset.Asset) ClassLoaderAsset(org.jboss.shrinkwrap.api.asset.ClassLoaderAsset) ClassLoaderAsset(org.jboss.shrinkwrap.api.asset.ClassLoaderAsset) Deployment(org.jboss.arquillian.container.test.api.Deployment)

Example 3 with PersistenceDescriptor

use of org.jboss.shrinkwrap.descriptor.api.persistence20.PersistenceDescriptor in project hibernate-orm by hibernate.

the class DdlInWildFlyUsingBmtAndEmfTest method persistenceXml.

private static PersistenceDescriptor persistenceXml() {
    final PersistenceDescriptor pd = Descriptors.create(PersistenceDescriptor.class).version("2.1").createPersistenceUnit().name(PERSISTENCE_UNIT_NAME).transactionType(PersistenceUnitTransactionType._JTA).jtaDataSource("java:jboss/datasources/ExampleDS").clazz(WildFlyDdlEntity.class.getName()).excludeUnlistedClasses(true).getOrCreateProperties().createProperty().name("jboss.as.jpa.providerModule").value("org.hibernate:5.2").up().up().getOrCreateProperties().createProperty().name("hibernate.hbm2ddl.auto").value("create-drop").up().up().getOrCreateProperties().createProperty().name(AvailableSettings.JTA_PLATFORM).value(JBossAppServerJtaPlatform.class.getName()).up().up().up();
    System.out.println("persistence.xml: ");
    pd.exportTo(System.out);
    return pd;
}
Also used : PersistenceDescriptor(org.jboss.shrinkwrap.descriptor.api.persistence21.PersistenceDescriptor) WildFlyDdlEntity(org.hibernate.test.wf.ddl.WildFlyDdlEntity)

Aggregations

WildFlyDdlEntity (org.hibernate.test.wf.ddl.WildFlyDdlEntity)2 PersistenceDescriptor (org.jboss.shrinkwrap.descriptor.api.persistence21.PersistenceDescriptor)2 Deployment (org.jboss.arquillian.container.test.api.Deployment)1 Asset (org.jboss.shrinkwrap.api.asset.Asset)1 ClassLoaderAsset (org.jboss.shrinkwrap.api.asset.ClassLoaderAsset)1 EmptyAsset (org.jboss.shrinkwrap.api.asset.EmptyAsset)1 StringAsset (org.jboss.shrinkwrap.api.asset.StringAsset)1 PersistenceDescriptor (org.jboss.shrinkwrap.descriptor.api.persistence20.PersistenceDescriptor)1