Author: epbernard
Date: 2007-01-24 16:21:14 -0500 (Wed, 24 Jan 2007)
New Revision: 11098
Modified:
trunk/HibernateExt/ejb/src/java/org/hibernate/ejb/packaging/PersistenceXmlLoader.java
Log:
Rollback from Bill's changes in HEAD (ported in 3.2)
Modified:
trunk/HibernateExt/ejb/src/java/org/hibernate/ejb/packaging/PersistenceXmlLoader.java
===================================================================
---
trunk/HibernateExt/ejb/src/java/org/hibernate/ejb/packaging/PersistenceXmlLoader.java 2007-01-24
16:54:32 UTC (rev 11097)
+++
trunk/HibernateExt/ejb/src/java/org/hibernate/ejb/packaging/PersistenceXmlLoader.java 2007-01-24
21:21:14 UTC (rev 11098)
@@ -68,12 +68,8 @@
return doc;
}
- public static List<PersistenceMetadata> deploy(URL url, Map overrides,
EntityResolver resolver) throws Exception {
- return deploy(url, overrides, resolver,
PersistenceUnitTransactionType.RESOURCE_LOCAL);
- }
+ public static List<PersistenceMetadata> deploy(URL url, Map overrides,
EntityResolver resolver) throws Exception {
-
- public static List<PersistenceMetadata> deploy(URL url, Map overrides,
EntityResolver resolver, PersistenceUnitTransactionType defaultTransactionType) throws
Exception {
Document doc = loadURL( url, resolver );
Element top = doc.getDocumentElement();
NodeList children = top.getChildNodes();
@@ -83,7 +79,7 @@
Element element = (Element) children.item( i );
String tag = element.getTagName();
if ( tag.equals( "persistence-unit" ) ) {
- PersistenceMetadata metadata = parsePersistenceUnit( element,
defaultTransactionType);
+ PersistenceMetadata metadata = parsePersistenceUnit( element );
//override properties of metadata if needed
String provider = (String) overrides.get( HibernatePersistence.PROVIDER );
if ( provider != null ) {
@@ -111,7 +107,7 @@
return units;
}
- private static PersistenceMetadata parsePersistenceUnit(Element top,
PersistenceUnitTransactionType defaultTransactionType)
+ private static PersistenceMetadata parsePersistenceUnit(Element top)
throws Exception {
PersistenceMetadata metadata = new PersistenceMetadata();
String puName = top.getAttribute( "name" );
@@ -121,7 +117,7 @@
}
PersistenceUnitTransactionType transactionType = getTransactionType( top.getAttribute(
"transaction-type" ) );
//parsing a persistence.xml means we are in a JavaSE environment
- transactionType = transactionType != null ? transactionType : defaultTransactionType;
+ transactionType = transactionType != null ? transactionType :
PersistenceUnitTransactionType.RESOURCE_LOCAL;
metadata.setTransactionType( transactionType );
NodeList children = top.getChildNodes();
for ( int i = 0; i < children.getLength() ; i++ ) {