fixed bug 16167: Fixed Oracle CLOB in 2.50 grid
authorAsier Lostalé <asier.lostale@openbravo.com>
Tue, 08 Mar 2011 13:49:44 +0100
changeset 11093 a1f65b603342
parent 11092 9748e2df70e8
child 11094 894a91f93223
fixed bug 16167: Fixed Oracle CLOB in 2.50 grid

When the size of a CLOB column was higher than 4000 characters, it failed
in 2.50 grid.
src-db/database/sourcedata/AD_COLUMN.xml
src/org/openbravo/erpCommon/utility/ExecuteQuery.java
src/org/openbravo/reference/ui/UIReferenceUtility.java
--- a/src-db/database/sourcedata/AD_COLUMN.xml	Tue Mar 08 13:41:07 2011 +0100
+++ b/src-db/database/sourcedata/AD_COLUMN.xml	Tue Mar 08 13:49:44 2011 +0100
@@ -277768,7 +277768,7 @@
 <!--5882B93E0C44C2A0E040007F01012513-->  <HELP><![CDATA[The context in which a Process Request was scheduled or executed. The context contains information such as user, client, organization, language, date format etc.]]></HELP>
 <!--5882B93E0C44C2A0E040007F01012513-->  <COLUMNNAME><![CDATA[OB_Context]]></COLUMNNAME>
 <!--5882B93E0C44C2A0E040007F01012513-->  <AD_TABLE_ID><![CDATA[82D4EDCF39AE44FB9B24E95A1B18B21C]]></AD_TABLE_ID>
-<!--5882B93E0C44C2A0E040007F01012513-->  <AD_REFERENCE_ID><![CDATA[10]]></AD_REFERENCE_ID>
+<!--5882B93E0C44C2A0E040007F01012513-->  <AD_REFERENCE_ID><![CDATA[14]]></AD_REFERENCE_ID>
 <!--5882B93E0C44C2A0E040007F01012513-->  <FIELDLENGTH><![CDATA[4000]]></FIELDLENGTH>
 <!--5882B93E0C44C2A0E040007F01012513-->  <ISKEY><![CDATA[N]]></ISKEY>
 <!--5882B93E0C44C2A0E040007F01012513-->  <ISPARENT><![CDATA[N]]></ISPARENT>
--- a/src/org/openbravo/erpCommon/utility/ExecuteQuery.java	Tue Mar 08 13:41:07 2011 +0100
+++ b/src/org/openbravo/erpCommon/utility/ExecuteQuery.java	Tue Mar 08 13:49:44 2011 +0100
@@ -312,7 +312,7 @@
     } catch (SQLException e) {
       log4j.error("SQL error in query: " + strSQL.toString() + "Exception:" + e);
       throw new ServletException("@CODE=" + Integer.toString(e.getErrorCode()) + "@"
-          + e.getMessage());
+          + e.getMessage(), e);
     } catch (Exception ex) {
       log4j.error("Exception in query: " + strSQL.toString() + "Exception:" + ex);
       throw new ServletException("@CODE=@" + ex.getMessage());
--- a/src/org/openbravo/reference/ui/UIReferenceUtility.java	Tue Mar 08 13:41:07 2011 +0100
+++ b/src/org/openbravo/reference/ui/UIReferenceUtility.java	Tue Mar 08 13:49:44 2011 +0100
@@ -11,7 +11,7 @@
  * under the License. 
  * The Original Code is Openbravo ERP. 
  * The Initial Developer of the Original Code is Openbravo SLU 
- * All portions are Copyright (C) 2010 Openbravo SLU 
+ * All portions are Copyright (C) 2010-2011 Openbravo SLU 
  * All Rights Reserved. 
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -156,8 +156,7 @@
     } else if (reference.equals("20")) {
       // YESNO
       result = "COALESCE(" + field + ", 'N')";
-    } else if (reference.equals("23")) {
-      // Binary
+    } else if (reference.equals("23") /* Binary */|| reference.equals("14")/* Text */) {
       result = field;
     } else {
       result = "COALESCE(TO_CHAR(" + field + "),'')";