use of org.jboss.shrinkwrap.descriptor.api.persistence21.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;
}
use of org.jboss.shrinkwrap.descriptor.api.persistence21.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");
}
use of org.jboss.shrinkwrap.descriptor.api.persistence21.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;
}
Aggregations