details:   https://code.openbravo.com/erp/devel/pi/rev/eefb7b36438c
changeset: 17479:eefb7b36438c
user:      Augusto Mauch <augusto.mauch <at> openbravo.com>
date:      Mon Jul 16 13:41:04 2012 +0200
summary:   Fixes issue 21073: Computed columns do not need a database column

If a column is a computed column (it has defined sql logic), it does not need 
to have a database column.

diffstat:

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

diffs (20 lines):

diff -r 9b1b0a268de2 -r eefb7b36438c 
src/org/openbravo/service/system/DatabaseValidator.java
--- a/src/org/openbravo/service/system/DatabaseValidator.java   Mon Jul 16 
10:20:22 2012 +0200
+++ b/src/org/openbravo/service/system/DatabaseValidator.java   Mon Jul 16 
13:41:04 2012 +0200
@@ -429,7 +429,15 @@
 
     final String moduleId = (getValidateModule() == null ? null : 
getValidateModule().getId());
     for (Column column : adTable.getADColumnList()) {
-      final boolean checkColumn = moduleId == null || 
(column.getModule().getId().equals(moduleId));
+      boolean hasSqlLogic;
+      if (column.getSqllogic() != null && !column.getSqllogic().isEmpty()) {
+        hasSqlLogic = true;
+      } else {
+        hasSqlLogic = false;
+      }
+      // If the column has SQL logic, it does not need to be present in the 
database
+      final boolean checkColumn = (moduleId == null || 
(column.getModule().getId().equals(moduleId)))
+          && !hasSqlLogic;
       if (!checkColumn) {
         dbColumnsByName.remove(column.getDBColumnName().toUpperCase());
         continue;

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to