diff --git a/db/ddlutils/oracle/ant.sh b/db/ddlutils/oracle/ant.sh index 19b9410a1b..9e1db41a64 100644 --- a/db/ddlutils/oracle/ant.sh +++ b/db/ddlutils/oracle/ant.sh @@ -1 +1 @@ -java -Xms128m -Xmx512m -classpath "../../../tools/lib/ant.jar;../../../tools/lib/ant-launcher.jar;../../../tools/lib/ant-swing.jar;../../../tools/lib/ant-commons-net.jar;../../../tools/lib/commons-net.jar" -Dant.home="." org.apache.tools.ant.Main $* +java -Xms128m -Xmx512m -classpath "../../../targetPlatform/plugins/org.apache.ant_1.7.1.v20100518-1145/lib/ant.jar:../../../targetPlatform/plugins/org.apache.ant_1.7.1.v20100518-1145/lib/ant-launcher.jar:../../../targetPlatform/plugins/org.apache.ant_1.7.1.v20100518-1145/lib/ant-swing.jar:../../../targetPlatform/plugins/org.apache.ant_1.7.1.v20100518-1145/lib/ant-commons-net.jar" -Dant.home="." org.apache.tools.ant.Main $* diff --git a/migration/i2.1/oracle/201506162003_IDEMPIERE-2685.sql b/migration/i2.1/oracle/201506162003_IDEMPIERE-2685.sql new file mode 100644 index 0000000000..7b43fe2c12 --- /dev/null +++ b/migration/i2.1/oracle/201506162003_IDEMPIERE-2685.sql @@ -0,0 +1,14 @@ +SET SQLBLANKLINES ON +SET DEFINE OFF + +-- Jun 16, 2015 7:11:44 PM CEST +-- IDEMPIERE - 2685 +UPDATE AD_Column SET ReadOnlyLogic='@#ShowAdvanced@ = N',Updated=TO_DATE('2015-06-16 19:11:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=50209 +; + +-- Jun 16, 2015 7:11:49 PM CEST +UPDATE AD_Column SET ReadOnlyLogic='@#ShowAdvanced@ = N',Updated=TO_DATE('2015-06-16 19:11:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=54091 +; + +SELECT register_migration_script('201506162003_IDEMPIERE-2685.sql') FROM dual +; \ No newline at end of file diff --git a/migration/i2.1/postgresql/201506162003_IDEMPIERE-2685.sql b/migration/i2.1/postgresql/201506162003_IDEMPIERE-2685.sql new file mode 100644 index 0000000000..6cc8b950e5 --- /dev/null +++ b/migration/i2.1/postgresql/201506162003_IDEMPIERE-2685.sql @@ -0,0 +1,11 @@ +-- Jun 16, 2015 7:11:44 PM CEST +-- IDEMPIERE - 2685 +UPDATE AD_Column SET ReadOnlyLogic='@#ShowAdvanced@ = N',Updated=TO_TIMESTAMP('2015-06-16 19:11:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=50209 +; + +-- Jun 16, 2015 7:11:49 PM CEST +UPDATE AD_Column SET ReadOnlyLogic='@#ShowAdvanced@ = N',Updated=TO_TIMESTAMP('2015-06-16 19:11:49','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=0 WHERE AD_Column_ID=54091 +; + +SELECT register_migration_script('201506162003_IDEMPIERE-2685.sql') FROM dual +; \ No newline at end of file diff --git a/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java b/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java index b09a709829..fefb3c228b 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java +++ b/org.adempiere.base.process/src/org/compiere/process/ColumnEncryption.java @@ -320,7 +320,8 @@ public class ColumnEncryption extends SvrProcess { ResultSet rs = null; try { - selectStmt = m_conn.prepareStatement(selectSql.toString(), + String selectSqlStr = DB.getDatabase().convertStatement(selectSql.toString()); + selectStmt = m_conn.prepareStatement(selectSqlStr, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); updateStmt = m_conn.prepareStatement(updateSql.toString()); @@ -397,7 +398,8 @@ public class ColumnEncryption extends SvrProcess { ResultSet rs = null; try { - selectStmt = m_conn.prepareStatement(selectSql.toString(), + String selectSqlStr = DB.getDatabase().convertStatement(selectSql.toString()); + selectStmt = m_conn.prepareStatement(selectSqlStr, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); updateStmt = m_conn.prepareStatement(updateSql.toString()); @@ -460,10 +462,7 @@ public class ColumnEncryption extends SvrProcess { int rowsEffected = -1; // Select SQL - StringBuilder selectSql = new StringBuilder(); - selectSql.append("SELECT FieldLength"); - selectSql.append(" FROM AD_Column"); - selectSql.append(" WHERE AD_Column_ID=?"); + String selectSql = "SELECT FieldLength FROM AD_Column WHERE AD_Column_ID=?"; // Alter SQL StringBuilder alterSql = new StringBuilder(); @@ -482,7 +481,8 @@ public class ColumnEncryption extends SvrProcess { ResultSet rs = null; try { - selectStmt = m_conn.prepareStatement(selectSql.toString(), + selectSql = DB.getDatabase().convertStatement(selectSql); + selectStmt = m_conn.prepareStatement(selectSql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); selectStmt.setInt(1, columnID); @@ -490,6 +490,7 @@ public class ColumnEncryption extends SvrProcess { if (rs.next()) { // Change the column size physically. + alterSql = new StringBuilder(DB.getDatabase().convertStatement(alterSql.toString())); if (DB.executeUpdate(alterSql.toString(), false, m_trx .getTrxName()) == -1) { log.severe("EncryptError [ChangeFieldLength]: ColumnID=" @@ -498,6 +499,7 @@ public class ColumnEncryption extends SvrProcess { } // Change the column size in AD. + updateSql = new StringBuilder(DB.getDatabase().convertStatement(updateSql.toString())); if (DB.executeUpdate(updateSql.toString(), false, m_trx .getTrxName()) == -1) { log.severe("EncryptError [ChangeFieldLength]: ColumnID=" diff --git a/org.adempiere.base.process/src/org/compiere/process/ReplicationLocal.java b/org.adempiere.base.process/src/org/compiere/process/ReplicationLocal.java index 7e76fa705e..0ae55bbb6b 100644 --- a/org.adempiere.base.process/src/org/compiere/process/ReplicationLocal.java +++ b/org.adempiere.base.process/src/org/compiere/process/ReplicationLocal.java @@ -541,6 +541,7 @@ public class ReplicationLocal extends SvrProcess // try { + sql = DB.getDatabase().convertStatement(sql); pstmt = conn.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); // Set Parameters diff --git a/org.adempiere.base/src/org/compiere/model/GridField.java b/org.adempiere.base/src/org/compiere/model/GridField.java index b11958d595..fddf8a8361 100644 --- a/org.adempiere.base/src/org/compiere/model/GridField.java +++ b/org.adempiere.base/src/org/compiere/model/GridField.java @@ -784,7 +784,7 @@ public class GridField private Object createDefault (String value) { // true NULL - if (value == null || value.toString().length() == 0) + if (value == null || value.toString().length() == 0 || value.toUpperCase().equals("NULL")) return null; // see also MTable.readData try diff --git a/org.adempiere.base/src/org/compiere/model/MSequence.java b/org.adempiere.base/src/org/compiere/model/MSequence.java index d0859d301d..a16fc8fbe9 100644 --- a/org.adempiere.base/src/org/compiere/model/MSequence.java +++ b/org.adempiere.base/src/org/compiere/model/MSequence.java @@ -125,6 +125,8 @@ public class MSequence extends X_AD_Sequence + " AND IsActive='Y' AND IsTableID='Y' AND IsAutoSequence='Y' "; } + if (!DB.isOracle() && !DB.isPostgreSQL()) + selectSQL = DB.getDatabase().convertStatement(selectSQL); Connection conn = null; PreparedStatement pstmt = null; @@ -221,12 +223,16 @@ public class MSequence extends X_AD_Sequence { int incrementNo = rs.getInt(3); if (adempiereSys) { - updateSQL = conn - .prepareStatement("UPDATE AD_Sequence SET CurrentNextSys = CurrentNextSys + ? WHERE AD_Sequence_ID = ?"); + String updateCmd = "UPDATE AD_Sequence SET CurrentNextSys=CurrentNextSys+? WHERE AD_Sequence_ID=?"; + if (!DB.isOracle() && !DB.isPostgreSQL()) + updateCmd = DB.getDatabase().convertStatement(updateCmd); + updateSQL = conn.prepareStatement(updateCmd); retValue = rs.getInt(2); } else { - updateSQL = conn - .prepareStatement("UPDATE AD_Sequence SET CurrentNext = CurrentNext + ? WHERE AD_Sequence_ID = ?"); + String updateCmd = "UPDATE AD_Sequence SET CurrentNext=CurrentNext+? WHERE AD_Sequence_ID=?"; + if (!DB.isOracle() && !DB.isPostgreSQL()) + updateCmd = DB.getDatabase().convertStatement(updateCmd); + updateSQL = conn.prepareStatement(updateCmd); retValue = rs.getInt(1); } updateSQL.setInt(1, incrementNo); @@ -367,6 +373,8 @@ public class MSequence extends X_AD_Sequence selectSQL = selectSQL + " FOR UPDATE OF s"; } } + if (!DB.isOracle() && !DB.isPostgreSQL()) + selectSQL = DB.getDatabase().convertStatement(selectSQL); Connection conn = null; Trx trx = trxName == null ? null : Trx.get(trxName, true); // @@ -439,7 +447,10 @@ public class MSequence extends X_AD_Sequence try { if (adempiereSys) { - updateSQL = conn.prepareStatement("UPDATE AD_Sequence SET CurrentNextSys = CurrentNextSys + ? WHERE AD_Sequence_ID = ?"); + String updateCmd = "UPDATE AD_Sequence SET CurrentNextSys = CurrentNextSys + ? WHERE AD_Sequence_ID = ?"; + if (!DB.isOracle() && !DB.isPostgreSQL()) + updateCmd = DB.getDatabase().convertStatement(updateCmd); + updateSQL = conn.prepareStatement(updateCmd); next = rs.getInt(2); } else { String sql; @@ -447,6 +458,8 @@ public class MSequence extends X_AD_Sequence sql = "UPDATE AD_Sequence_No SET CurrentNext = CurrentNext + ? WHERE AD_Sequence_ID=? AND CalendarYearMonth=? AND AD_Org_ID=?"; else sql = "UPDATE AD_Sequence SET CurrentNext = CurrentNext + ? WHERE AD_Sequence_ID=?"; + if (!DB.isOracle() && !DB.isPostgreSQL()) + sql = DB.getDatabase().convertStatement(sql); updateSQL = conn.prepareStatement(sql); next = rs.getInt(1); } diff --git a/org.adempiere.base/src/org/compiere/model/PO_LOB.java b/org.adempiere.base/src/org/compiere/model/PO_LOB.java index fec006f834..508ef57729 100644 --- a/org.adempiere.base/src/org/compiere/model/PO_LOB.java +++ b/org.adempiere.base/src/org/compiere/model/PO_LOB.java @@ -115,6 +115,8 @@ public class PO_LOB implements Serializable .append(m_tableName) .append(" SET ").append(m_columnName) .append("=? WHERE ").append(m_whereClause); + if (!DB.isPostgreSQL() && !DB.isOracle()) + sql = new StringBuffer(DB.getDatabase().convertStatement(sql.toString())); // if (log.isLoggable(Level.FINE)) log.fine("[" + trxName + "] - Local - " + m_value); diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java index 7589cb4f5c..0e530a5075 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/adwindow/AbstractADWindowContent.java @@ -1564,10 +1564,9 @@ public abstract class AbstractADWindowContent extends AbstractUIPart implements { GridTab gt = adTabbox.getSelectedGridTab(); String trxInfo = gt.getStatusLine(); - if (trxInfo != null) - { - statusBar.setInfo(trxInfo); - } + if (trxInfo == null) + trxInfo = ""; + statusBar.setInfo(trxInfo); SessionManager.getAppDesktop().updateHelpQuickInfo(gt); } diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java index ac4ba38e7b..fa3fa9a672 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/panel/InfoGeneralPanel.java @@ -409,12 +409,12 @@ public class InfoGeneralPanel extends InfoPanel implements EventListener { if (Env.isBaseLanguage(Env.getCtx(), "AD_Ref_List")) colSql = new StringBuffer("(SELECT l.Name FROM AD_Ref_List l WHERE l.AD_Reference_ID=") - .append(AD_Reference_Value_ID).append(" AND l.Value=").append(columnSql) + .append(AD_Reference_Value_ID).append(" AND l.Value=").append(tableName).append(".").append(columnSql) .append(") AS ").append(columnName); else colSql = new StringBuffer("(SELECT t.Name FROM AD_Ref_List l, AD_Ref_List_Trl t " + "WHERE l.AD_Ref_List_ID=t.AD_Ref_List_ID AND l.AD_Reference_ID=") - .append(AD_Reference_Value_ID).append(" AND l.Value=").append(columnSql) + .append(AD_Reference_Value_ID).append(" AND l.Value=").append(tableName).append(".").append(columnSql) .append(" AND t.AD_Language='").append(Env.getAD_Language(Env.getCtx())) .append("') AS ").append(columnName); colClass = String.class;