details: /erp/devel/pi/rev/245a3fec08f8
changeset: 8214:245a3fec08f8
user: Stefan Hühner <stefan.huehner <at> openbravo.com>
date: Tue Aug 24 19:50:16 2010 +0200
summary: Issue 14255: split public xsql-file into two non-public files
After first changeset in 15255 two packages accessed the then public
ComboTableQuery_data.xsql in erpCommon/utility.
This changeset split this one file into two non-public ones. First in
erpCommon/utility contains the SqlMethod's used there, and second one
contains only the functions used in reference/ui.
This way both xsql files don't need to be public.
There are no overlapping functions between the two xsql files.
diffstat:
src/org/openbravo/erpCommon/utility/ComboTableQuery_data.xsql | 67 +-------
src/org/openbravo/reference/ui/ComboTableQuery_data.xsql | 93 +++++++++++
src/org/openbravo/reference/ui/UIList.java | 1 -
src/org/openbravo/reference/ui/UIReferenceUtility.java | 1 -
src/org/openbravo/reference/ui/UITable.java | 1 -
src/org/openbravo/reference/ui/UITableDir.java | 1 -
6 files changed, 94 insertions(+), 70 deletions(-)
diffs (227 lines):
diff -r 215be63868e7 -r 245a3fec08f8
src/org/openbravo/erpCommon/utility/ComboTableQuery_data.xsql
--- a/src/org/openbravo/erpCommon/utility/ComboTableQuery_data.xsql Tue Aug
24 17:07:32 2010 +0200
+++ b/src/org/openbravo/erpCommon/utility/ComboTableQuery_data.xsql Tue Aug
24 19:50:16 2010 +0200
@@ -22,52 +22,9 @@
-<SqlClass name="ComboTableQueryData" package="org.openbravo.erpCommon.utility"
accessModifier="public">
+<SqlClass name="ComboTableQueryData" package="org.openbravo.erpCommon.utility">
<SqlClassComment></SqlClassComment>
- <SqlMethod name="selectRefTable" type="preparedStatement" return="multiple">
- <SqlMethodComment></SqlMethodComment>
- <Sql>
- <![CDATA[
- SELECT ad_ref_table.ad_reference_id as referenceId, ad_table.tablename
as tableName, c1.columnname as keyName, c2.columnname as displayName,
isvaluedisplayed, c2.columnname as columnname,
- whereclause, orderbyclause, '' as clause,
- c2.columnname as name, c2.ad_reference_id as reference, 'Y' as
required, c2.AD_REFERENCE_VALUE_ID as referenceValue
- FROM ad_ref_table, ad_table, ad_column c1, ad_column c2
- WHERE ad_ref_table.ad_table_id = ad_table.ad_table_id
- AND ad_ref_table.ad_key = c1.ad_column_id
- AND ad_ref_table.ad_display = c2.ad_column_id
- AND ad_ref_table.ad_reference_id = ?
- ]]>
- </Sql>
- <Parameter name="reference"/>
- </SqlMethod>
- <SqlMethod name="isValueDisplayed" type="preparedStatement"
return="boolean">
- <SqlMethodComment></SqlMethodComment>
- <Sql>
- <![CDATA[
- SELECT count(*) as isvaluedisplayed
- FROM ad_reference
- WHERE ad_reference_id = ?
- AND isvaluedisplayed = 'Y'
- ]]>
- </Sql>
- <Parameter name="reference"/>
- </SqlMethod>
-
- <SqlMethod name="identifierColumns" type="preparedStatement"
return="multiple">
- <SqlMethodComment></SqlMethodComment>
- <Sql>
- SELECT ad_column.columnname as name, ad_reference_id as reference,
ismandatory as required,
- REPLACE(replace(REPLACE(AD_ELEMENT.columnname, 'Substitute_ID',
'M_Product_ID'), 'BOM_ID', '_ID'), 'M_LocatorTo_ID', 'M_Locator_ID') as
columnname, ad_reference_value_id as referencevalue, ad_table.tablename AS
tablename
- FROM ad_column left join ad_element on ad_column.ad_element_id =
ad_element.ad_element_id,
- ad_table
- WHERE UPPER(ad_table.tablename) = UPPER(?)
- AND ad_column.ad_table_id = ad_table.ad_table_id
- AND isidentifier = 'Y'
- ORDER BY ad_column.SeqNo
- </Sql>
- <Parameter name="tableName"/>
- </SqlMethod>
<SqlMethod name="getValidation" type="preparedStatement" return="String"
default="">
<SqlMethodComment></SqlMethodComment>
<Sql>
@@ -77,28 +34,6 @@
</Sql>
<Parameter name="adValRuleId"/>
</SqlMethod>
- <SqlMethod name="selectTranslatedColumn" type="preparedStatement"
return="multiple">
- <SqlMethodComment></SqlMethodComment>
- <Sql>
- <![CDATA[
- SELECT T_TRL.TABLENAME AS TABLENAME, C_TRL.COLUMNNAME AS COLUMNNAME,
C_ID.COLUMNNAME AS REFERENCE
- FROM AD_COLUMN C, AD_TABLE T, AD_TABLE T_TRL, AD_COLUMN C_TRL,
- AD_COLUMN C_ID
- WHERE T.AD_TABLE_ID = C.AD_TABLE_ID
- AND UPPER(T.TABLENAME) = UPPER(?)
- AND C.ISTRANSLATED = 'Y'
- AND UPPER(C.COLUMNNAME) = UPPER(?)
- AND (UPPER(T.TABLENAME) || '_TRL') = UPPER(T_TRL.TABLENAME)
- AND T_TRL.AD_TABLE_ID = C_TRL.AD_TABLE_ID
- AND UPPER(C.COLUMNNAME) = UPPER(C_TRL.COLUMNNAME)
- AND T.AD_TABLE_ID = C_ID.AD_TABLE_ID
- AND (C_ID.ISSECONDARYKEY = 'Y' OR C_ID.ISKEY = 'Y')
- AND UPPER(C_ID.COLUMNNAME) <> 'AD_LANGUAGE'
- ]]>
- </Sql>
- <Parameter name="tablename"/>
- <Parameter name="columnname"/>
- </SqlMethod>
<SqlMethod name="getReferenceID" type="preparedStatement" return="String"
default="">
<SqlMethodComment></SqlMethodComment>
<Sql>
diff -r 215be63868e7 -r 245a3fec08f8
src/org/openbravo/reference/ui/ComboTableQuery_data.xsql
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/org/openbravo/reference/ui/ComboTableQuery_data.xsql Tue Aug 24
19:50:16 2010 +0200
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo Public License
+ * Version 1.0 (the "License"), being the Mozilla Public License
+ * Version 1.1 with a permitted attribution clause; you may not use this
+ * file except in compliance with the License. You may obtain a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * Software distributed under the License is distributed on an "AS IS"
+ * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+ * License for the specific language governing rights and limitations
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SLU
+ * All portions are Copyright (C) 2001-2010 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s): ______________________________________.
+ ************************************************************************
+-->
+
+
+
+
+
+<SqlClass name="ComboTableQueryData" package="org.openbravo.reference.ui">
+ <SqlClassComment></SqlClassComment>
+ <SqlMethod name="selectRefTable" type="preparedStatement" return="multiple">
+ <SqlMethodComment></SqlMethodComment>
+ <Sql>
+ <![CDATA[
+ SELECT ad_ref_table.ad_reference_id as referenceId, ad_table.tablename
as tableName, c1.columnname as keyName, c2.columnname as displayName,
isvaluedisplayed, c2.columnname as columnname,
+ whereclause, orderbyclause, '' as clause,
+ c2.columnname as name, c2.ad_reference_id as reference, 'Y' as
required, c2.AD_REFERENCE_VALUE_ID as referenceValue
+ FROM ad_ref_table, ad_table, ad_column c1, ad_column c2
+ WHERE ad_ref_table.ad_table_id = ad_table.ad_table_id
+ AND ad_ref_table.ad_key = c1.ad_column_id
+ AND ad_ref_table.ad_display = c2.ad_column_id
+ AND ad_ref_table.ad_reference_id = ?
+ ]]>
+ </Sql>
+ <Parameter name="reference"/>
+ </SqlMethod>
+
+ <SqlMethod name="isValueDisplayed" type="preparedStatement"
return="boolean">
+ <SqlMethodComment></SqlMethodComment>
+ <Sql>
+ <![CDATA[
+ SELECT count(*) as isvaluedisplayed
+ FROM ad_reference
+ WHERE ad_reference_id = ?
+ AND isvaluedisplayed = 'Y'
+ ]]>
+ </Sql>
+ <Parameter name="reference"/>
+ </SqlMethod>
+
+ <SqlMethod name="identifierColumns" type="preparedStatement"
return="multiple">
+ <SqlMethodComment></SqlMethodComment>
+ <Sql>
+ SELECT ad_column.columnname as name, ad_reference_id as reference,
ismandatory as required,
+ REPLACE(replace(REPLACE(AD_ELEMENT.columnname, 'Substitute_ID',
'M_Product_ID'), 'BOM_ID', '_ID'), 'M_LocatorTo_ID', 'M_Locator_ID') as
columnname, ad_reference_value_id as referencevalue, ad_table.tablename AS
tablename
+ FROM ad_column left join ad_element on ad_column.ad_element_id =
ad_element.ad_element_id,
+ ad_table
+ WHERE UPPER(ad_table.tablename) = UPPER(?)
+ AND ad_column.ad_table_id = ad_table.ad_table_id
+ AND isidentifier = 'Y'
+ ORDER BY ad_column.SeqNo
+ </Sql>
+ <Parameter name="tableName"/>
+ </SqlMethod>
+ <SqlMethod name="selectTranslatedColumn" type="preparedStatement"
return="multiple">
+ <SqlMethodComment></SqlMethodComment>
+ <Sql>
+ <![CDATA[
+ SELECT T_TRL.TABLENAME AS TABLENAME, C_TRL.COLUMNNAME AS COLUMNNAME,
C_ID.COLUMNNAME AS REFERENCE
+ FROM AD_COLUMN C, AD_TABLE T, AD_TABLE T_TRL, AD_COLUMN C_TRL,
+ AD_COLUMN C_ID
+ WHERE T.AD_TABLE_ID = C.AD_TABLE_ID
+ AND UPPER(T.TABLENAME) = UPPER(?)
+ AND C.ISTRANSLATED = 'Y'
+ AND UPPER(C.COLUMNNAME) = UPPER(?)
+ AND (UPPER(T.TABLENAME) || '_TRL') = UPPER(T_TRL.TABLENAME)
+ AND T_TRL.AD_TABLE_ID = C_TRL.AD_TABLE_ID
+ AND UPPER(C.COLUMNNAME) = UPPER(C_TRL.COLUMNNAME)
+ AND T.AD_TABLE_ID = C_ID.AD_TABLE_ID
+ AND (C_ID.ISSECONDARYKEY = 'Y' OR C_ID.ISKEY = 'Y')
+ AND UPPER(C_ID.COLUMNNAME) <> 'AD_LANGUAGE'
+ ]]>
+ </Sql>
+ <Parameter name="tablename"/>
+ <Parameter name="columnname"/>
+ </SqlMethod>
+</SqlClass>
diff -r 215be63868e7 -r 245a3fec08f8 src/org/openbravo/reference/ui/UIList.java
--- a/src/org/openbravo/reference/ui/UIList.java Tue Aug 24 17:07:32
2010 +0200
+++ b/src/org/openbravo/reference/ui/UIList.java Tue Aug 24 19:50:16
2010 +0200
@@ -31,7 +31,6 @@
import org.openbravo.data.FieldProvider;
import org.openbravo.erpCommon.businessUtility.BuscadorData;
import org.openbravo.erpCommon.utility.ComboTableData;
-import org.openbravo.erpCommon.utility.ComboTableQueryData;
import org.openbravo.erpCommon.utility.TableSQLData;
public class UIList extends UIReference {
diff -r 215be63868e7 -r 245a3fec08f8
src/org/openbravo/reference/ui/UIReferenceUtility.java
--- a/src/org/openbravo/reference/ui/UIReferenceUtility.java Tue Aug 24
17:07:32 2010 +0200
+++ b/src/org/openbravo/reference/ui/UIReferenceUtility.java Tue Aug 24
19:50:16 2010 +0200
@@ -25,7 +25,6 @@
import org.openbravo.base.secureApp.VariablesSecureApp;
import org.openbravo.data.FieldProvider;
import org.openbravo.erpCommon.utility.ComboTableData;
-import org.openbravo.erpCommon.utility.ComboTableQueryData;
import org.openbravo.erpCommon.utility.SQLReturnObject;
import org.openbravo.erpCommon.utility.TableSQLData;
diff -r 215be63868e7 -r 245a3fec08f8 src/org/openbravo/reference/ui/UITable.java
--- a/src/org/openbravo/reference/ui/UITable.java Tue Aug 24 17:07:32
2010 +0200
+++ b/src/org/openbravo/reference/ui/UITable.java Tue Aug 24 19:50:16
2010 +0200
@@ -29,7 +29,6 @@
import org.openbravo.data.FieldProvider;
import org.openbravo.erpCommon.businessUtility.BuscadorData;
import org.openbravo.erpCommon.utility.ComboTableData;
-import org.openbravo.erpCommon.utility.ComboTableQueryData;
import org.openbravo.erpCommon.utility.TableSQLData;
import org.openbravo.reference.Reference;
diff -r 215be63868e7 -r 245a3fec08f8
src/org/openbravo/reference/ui/UITableDir.java
--- a/src/org/openbravo/reference/ui/UITableDir.java Tue Aug 24 17:07:32
2010 +0200
+++ b/src/org/openbravo/reference/ui/UITableDir.java Tue Aug 24 19:50:16
2010 +0200
@@ -30,7 +30,6 @@
import org.openbravo.database.ConnectionProvider;
import org.openbravo.erpCommon.businessUtility.BuscadorData;
import org.openbravo.erpCommon.utility.ComboTableData;
-import org.openbravo.erpCommon.utility.ComboTableQueryData;
import org.openbravo.erpCommon.utility.TableSQLData;
import org.openbravo.erpCommon.utility.Utility;
import org.openbravo.reference.Reference;
------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users
worldwide. Take advantage of special opportunities to increase revenue and
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits