details:   /erp/devel/pi/rev/a3213b55a054
changeset: 7935:a3213b55a054
user:      Antonio Moreno <antonio.moreno <at> openbravo.com>
date:      Thu Jul 29 13:17:26 2010 +0200
summary:   Fixed issue 13921. Improved validation so that the message is clearer
We haven't changed the naming rule used to infer the owner of a database 
column. Therefore, a column which starts with EM_dbprefix needs to use a 
dbprefix of a _different_ module from the one which owns the table (this makes 
sense, as EM means External Module). However, we have changed the message so 
that now it warns of this rule in case the column starts with EM_dbprefix and 
is missing in the physical model.

diffstat:

 src/org/openbravo/service/system/DatabaseValidator.java |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (19 lines):

diff -r 5ef94bee291c -r a3213b55a054 
src/org/openbravo/service/system/DatabaseValidator.java
--- a/src/org/openbravo/service/system/DatabaseValidator.java   Thu Jul 29 
12:34:09 2010 +0200
+++ b/src/org/openbravo/service/system/DatabaseValidator.java   Thu Jul 29 
13:17:26 2010 +0200
@@ -385,9 +385,14 @@
       final org.apache.ddlutils.model.Column dbColumn = 
dbColumnsByName.get(column
           .getDBColumnName().toUpperCase());
       if (dbColumn == null) {
+        String message = "";
+        if (column.getDBColumnName().substring(0, 3).equalsIgnoreCase("EM_")) {
+          message = " The problem could also be that the column name has a 
dbprefix of a non existant module or that it starts with the dbprefix of the 
module which owns the table. In this second case, the column doesn't need the 
'EM_DBPREFIX' prefix, you can use the name you want.";
+        }
         
result.addError(SystemValidationResult.SystemValidationType.NOT_EXIST_IN_DB, 
"Column "
             + adTable.getDBTableName() + "." + column.getDBColumnName()
-            + " defined in the Application Dictionary but not present in the 
database.");
+            + " defined in the Application Dictionary but not present in the 
database." + message);
+
       } else {
         checkDataType(column, dbColumn, result, dbTable);
 

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to