# HG changeset patch
# User Shankar Balachandran <shankar.balachandran@openbravo.com>
# Date 1365323204 -19800
# Node ID 72dd5845859461ebd774110bb777c2db81a3f331
# Parent  4a36ca94ba638ac4a7fe4e5bf373b6aa8642df56
Fixes Issue 0022304: Ignoring computed columns for foreign key validation

Computed columns are ignored when columns are checked for foreign key constraints

diff -r 4a36ca94ba63 -r 72dd58458594 src/org/openbravo/service/system/DatabaseValidator.java
--- a/src/org/openbravo/service/system/DatabaseValidator.java	Wed Apr 03 19:56:28 2013 +0200
+++ b/src/org/openbravo/service/system/DatabaseValidator.java	Sun Apr 07 13:56:44 2013 +0530
@@ -374,6 +374,12 @@
       return;
     }
     for (Property property : entity.getProperties()) {
+
+      // ignore computed columns
+      if (property.getSqlLogic() != null) {
+        continue;
+      }
+
       if (!property.isPrimitive() && !property.isOneToMany() && !property.isAuditInfo()) {
         // check if the property column is present in a foreign key
 
