svn commit: r673019 - in /ofbiz/trunk/framework/entity/src/org/ofbiz/entity: GenericDelegator.java GenericEntity.java model/ModelEntityChecker.java

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

svn commit: r673019 - in /ofbiz/trunk/framework/entity/src/org/ofbiz/entity: GenericDelegator.java GenericEntity.java model/ModelEntityChecker.java

jonesde
Author: jonesde
Date: Tue Jul  1 01:03:44 2008
New Revision: 673019

URL: http://svn.apache.org/viewvc?rev=673019&view=rev
Log:
Improved error messages in a few places so that hopefully more people will be able to figure it out when they don't have a datasource setup for a group of entities

Modified:
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java?rev=673019&r1=673018&r2=673019&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericDelegator.java Tue Jul  1 01:03:44 2008
@@ -431,7 +431,7 @@
         if (helperName != null && helperName.length() > 0) {
             return GenericHelperFactory.getHelper(helperName);
         } else {
-            throw new GenericEntityException("Helper name not found for entity " + entityName);
+            throw new GenericEntityException("There is no datasource (Helper) configured for the entity-group [" + this.getEntityGroupName(entityName) + "]; was trying to find datesource (helper) for entity [" + entityName + "]");
         }
     }
 

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java?rev=673019&r1=673018&r2=673019&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/GenericEntity.java Tue Jul  1 01:03:44 2008
@@ -392,7 +392,7 @@
                 Debug.logWarning(e, module);
             }
             if (type == null) {
-                throw new IllegalArgumentException("Type " + modelField.getType() + " not found");
+                throw new IllegalArgumentException("Type " + modelField.getType() + " not found for entity [" + this.getEntityName() + "]; probably because there is no datasource (helper) setup for the entity group that this entity is in: [" + this.getDelegator().getEntityGroupName(this.getEntityName()) + "]");
             }
 
             if (value instanceof Boolean) {

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java?rev=673019&r1=673018&r2=673019&view=diff
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/model/ModelEntityChecker.java Tue Jul  1 01:03:44 2008
@@ -81,10 +81,11 @@
                 String groupName = delegator.getEntityGroupName(entityName);
                 ModelEntity entity = reader.getModelEntity(entityName);
                 if (helperName == null) {
-                    warningList.add("[HelperNotFound] No Helper (DataSource) definition found for entity " + entity.getEntityName() + ".");
                     //only show group name warning if helper name not found
-                    if (groupName == null) {
+                    if (UtilValidate.isEmpty(groupName)) {
                             warningList.add("[GroupNotFound] No Group Name found for entity " + entity.getEntityName() + ".");
+                    } else {
+                        warningList.add("[HelperNotFound] No Helper (DataSource) definition found for entity [" + entity.getEntityName() + "] because there is no helper (datasource) configured for the entity group it is in: [" + groupName + "]");
                     }
                 }
                 if (entity.getPlainTableName() != null && entity.getPlainTableName().length() > 30) {