svn commit: r924803 - in /ofbiz/branches/multitenant20100310/framework/entity/src/org/ofbiz/entity: GenericDelegator.java model/ModelGroupReader.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r924803 - in /ofbiz/branches/multitenant20100310/framework/entity/src/org/ofbiz/entity: GenericDelegator.java model/ModelGroupReader.java

jonesde
Author: jonesde
Date: Thu Mar 18 14:25:56 2010
New Revision: 924803

URL: http://svn.apache.org/viewvc?rev=924803&view=rev
Log:
Fixed issue with ant run-tests where funny delegator names are used that don't match the delegator name in the entityengine.xml file; now all cloned delegators use the same delegatorBaseName as the original so that configuration settings will work; also includes improved error handling when a bad delegator name is used to get default group name info for a delegator

Modified:
    ofbiz/branches/multitenant20100310/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
    ofbiz/branches/multitenant20100310/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java

Modified: ofbiz/branches/multitenant20100310/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/multitenant20100310/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=924803&r1=924802&r2=924803&view=diff
==============================================================================
--- ofbiz/branches/multitenant20100310/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original)
+++ ofbiz/branches/multitenant20100310/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Thu Mar 18 14:25:56 2010
@@ -3245,6 +3245,9 @@ public class GenericDelegator implements
         newDelegator.modelReader = this.modelReader;
         newDelegator.modelGroupReader = this.modelGroupReader;
         newDelegator.setDelegatorNames(UtilValidate.isNotEmpty(delegatorFullName) ? delegatorFullName : this.delegatorFullName);
+        // set the delegatorBaseName to be the same so that configuration settings all work the same as the current
+        //   delegator, allowing the new delegatorFullName to not match a delegator name in the entityengine.xml file
+        newDelegator.delegatorBaseName = this.delegatorBaseName;
         newDelegator.delegatorInfo = this.delegatorInfo;
         newDelegator.cache = this.cache;
         newDelegator.andCacheFieldSets = this.andCacheFieldSets;

Modified: ofbiz/branches/multitenant20100310/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/multitenant20100310/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java?rev=924803&r1=924802&r2=924803&view=diff
==============================================================================
--- ofbiz/branches/multitenant20100310/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java (original)
+++ ofbiz/branches/multitenant20100310/framework/entity/src/org/ofbiz/entity/model/ModelGroupReader.java Thu Mar 18 14:25:56 2010
@@ -175,7 +175,11 @@ public class ModelGroupReader implements
         if (gc != null) {
             String groupName = gc.get(entityName);
             if (groupName == null) {
-                groupName = EntityConfigUtil.getDelegatorInfo(delegatorBaseName).defaultGroupName;
+                DelegatorInfo delegatorInfo = EntityConfigUtil.getDelegatorInfo(delegatorBaseName);
+                if (delegatorInfo == null) {
+                    throw new RuntimeException("Could not find DelegatorInfo for delegatorBaseName [" + delegatorBaseName + "]");
+                }
+                groupName = delegatorInfo.defaultGroupName;
             }
             return groupName;
         } else {