Trifon are you sure on this one? I made it same to original style. Otherwise why not just return list.toArray (retValue);?> http://adempiere.svn.sourceforge.net/adempiere/?rev=6836&view=rev
MAchievement.java
- list.toArray (retValue);
+ retValue = list.toArray (retValue);
I have a small comment regarding changes from M_Element class. There is much better to use firstOnly() method instead of first() then fetching the list and then checking if the list has only one element.
WDYT?
PS: Carlos, i know that the adviced way of writing comments is on trackers but this is a long term tracker where everybody is working & updating so i doubt that someone is checking it. So in this case, this approach is much more efficient ;)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Teo Sarca wrote:
> Hi Red1!
>
> I have a small comment regarding changes from M_Element class. There is much better to use firstOnly() method instead of first() then fetching the list and then checking if the list has only one element.
> WDYT?
>
> PS: Carlos, i know that the adviced way of writing comments is on trackers but this is a long term tracker where everybody is working & updating so i doubt that someone is checking it. So in this case, this approach is much more efficient ;)
I think ppl will check the tracker when it is updated via email list track monitoring.
I will follow Teo's advice and see about firstOnly() if it fulfills the code needs.
Thanks Teo.
red1
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Log Message:
-----------
Change SQL for Query class
Modified Paths:
--------------
branches/stable/base/src/org/compiere/model/MCash.java
Revision: 6829
http://adempiere.svn.sourceforge.net/adempiere/?rev=6829&view=rev
Author: vpj-cd
Date: 2008-11-01 22:53:50 +0000 (Sat, 01 Nov 2008)
Log Message:
-----------
do not is necessary the explicit cast
Modified Paths:
--------------
branches/stable/base/src/org/compiere/model/MCash.java
This change was test with new Cash and new Cash Journal complete and void
work perfectly
Victor Perez
www.e-evolution.com
Revision: 6830
http://adempiere.svn.sourceforge.net/adempiere/?rev=6830&view=rev
Author: vpj-cd
Date: 2008-11-02 00:06:07 +0000 (Sun, 02 Nov 2008)
Log Message:
-----------
[ 2214883 ] Remove SQL code and Replace for Query
http://sourceforge.net/tracker/index.php?func=detail&aid=2214883&group_id=176962&atid=879335
Tested with Create GL/Default process and change the name in account.
All is work perfectly
Kind regards
Victor Perez
www.e-evolution.com
Modified Paths:
--------------
branches/stable/base/src/org/compiere/model/MAccount.java
Revision: 6836
http://adempiere.svn.sourceforge.net/adempiere/?rev=6836&view=rev
Modified Paths:
--------------
branches/stable/base/src/org/compiere/model/MAcctSchemaGL.java
branches/stable/base/src/org/compiere/model/MAchievement.java
Adding names of last modified classes for reference to know from where to start next day.
Trifon are you sure on this one? I made it same to original style. Otherwise why not just return list.toArray (retValue);?>
http://adempiere.svn.sourceforge.net/adempiere/?rev=6836&view=rev
MAchievement.java
- list.toArray (retValue);
+ retValue = list.toArray (retValue);
I am in progress on this one >
http://adempiere.svn.sourceforge.net/adempiere/?rev=6833&view=rev
Modified Paths:
--------------
branches/stable/base/src/org/compiere/model/MBPartner.java
Revision: 6848
http://adempiere.svn.sourceforge.net/adempiere/?rev=6848&view=rev
Author: vpj-cd
Date: 2008-11-03 17:35:46 +0000 (Mon, 03 Nov 2008)
Log Message:
-----------
[ 2214883 ] Remove SQL code and Replace for Query
http://sourceforge.net/tracker/index.php?func=detail&aid=2214883&group_id=176962&atid=879335
Test executed
1.- Account View work.
2.- Create new Schema account work.
3.- Copy Default Account from other schema work.
4.- ComboBox for Account report work.
5.- Display Account lookup in BPartner work.
kind regards
Victor Perez
www.e-evolution.com
Modified Paths:
--------------
branches/stable/base/src/org/compiere/model/MAccount.java
branches/stable/base/src/org/compiere/model/MAccountLookup.java
branches/stable/base/src/org/compiere/model/MAcctProcessor.java
branches/stable/base/src/org/compiere/model/MAcctProcessorLog.java
branches/stable/base/src/org/compiere/model/MAcctSchema.java
branches/stable/base/src/org/compiere/model/MAcctSchemaDefault.java
branches/stable/base/src/org/compiere/model/MAcctSchemaElement.java
branches/stable/base/src/org/compiere/model/MAcctSchemaGL.java
Modified Paths:
--------------
branches/stable/base/src/org/compiere/model/MJournal.java
branches/stable/base/src/org/compiere/model/MAlert.java
with everyone's help :-)
Hi, for those following this tracker, but not forums, please read my comments about this task here:
https://sourceforge.net/forum/message.php?msg_id=5574546
Cordially,
Carlos Ruiz
http://adempiere.svn.sourceforge.net/adempiere/?rev=6910&view=rev at experimental branch
Query.java - Introducing SQL String prompt in Log.info
MTable.java - fix parameterized tag
Modified Paths:
--------------
branches/experimental/base/src/org/compiere/model/MClick.java
branches/experimental/base/src/org/compiere/model/MTable.java
branches/experimental/base/src/org/compiere/model/Query.java
As per discussion with Teo and Trifon, i m proposing the following code change:
Index: base/src/org/compiere/model/Query.java
--- base/src/org/compiere/model/Query.java (revision 6947)
+++ base/src/org/compiere/model/Query.java (working copy)
@@ -32,6 +32,7 @@
import org.adempiere.exceptions.DBException;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
+import org.compiere.util.Env;
import org.compiere.util.Util;
/**
@@ -39,11 +40,13 @@
* @author Low Heng Sin
* @author Teo Sarca, SC ARHIPAC SERVICE SRL
* <li>FR [ 1981760 ] Improve Query class
- * <li>BF [ 2030280 ] org.compiere.model.Query apply access fielter issue
+ * <li>BF [ 2030280 ] org.compiere.model.Query apply access filter issue
* <li>FR [ 2041894 ] Add Query.match() method
- * <li>FR [ 2107068 ] Query.setOrderBy should be more error tollerant
+ * <li>FR [ 2107068 ] Query.setOrderBy should be more error tolerant
* <li>FR [ 2107109 ] Add method Query.setOnlyActiveRecords
- * FR: [ 2214883 ] Remove SQL code and Replace for Query // introducing SQL String prompt in log.info - red1
+ * @author Redhuan D. Oon
+ * <li>FR: [ 2214883 ] Remove SQL code and Replace for Query // introducing SQL String prompt in log.info
+ * >li>FR: [ 2214883 ] - to introduce .setClient_ID
*/
public class Query
{
@@ -57,6 +60,7 @@
private Object[] parameters = null;
private boolean applyAccessFilter = false;
private boolean onlyActiveRecords = false;
+ private boolean Client_ID = false;
/**
*
@@ -162,6 +166,16 @@
}
/**
+ * Set Client_ID true for WhereClause routine to include AD_Client_ID
+ * @param Client_ID
+ */
+ public Query setClient_ID()
+ {
+ this.Client_ID = true;
+ return this;
+ }
+
+ /**
* Return a list of all po that match the query criteria.
* @return List
* @throws DBException
@@ -391,7 +405,17 @@
{
sqlBuffer.append(" AND IsActive=?");
}
-
+ }
+ if (this.Client_ID) //red1
+ {
+ if (Util.isEmpty(this.whereClause, true))
+ {
+ sqlBuffer.append(" WHERE AD_CLient_ID="+Env.getAD_Client_ID(ctx));
+ }
+ else
+ {
+ sqlBuffer.append(" AND IsActive="+Env.getAD_Client_ID(ctx));
+ } //red1 - end
}
if (useOrderByClause && orderBy != null && orderBy.trim().length() > 0)
{
got some typo mistake the last snippet. it should be:
sqlBuffer.append(" AND AD_Client_ID="+Env.getAD_Client_ID(ctx));
Revision: 8998
http://adempiere.svn.sourceforge.net/adempiere/?rev=8998&view=rev
Author: teo_sarca
Date: 2009-04-14 07:09:55 +0000 (Tue, 14 Apr 2009)
Log Message:
-----------
Remove SQL code and Replace for Query
https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2214883&group_id=176962
Modified Paths:
--------------
trunk/base/src/org/compiere/model/MAttributeSet.java
Revision: 9000
http://adempiere.svn.sourceforge.net/adempiere/?rev=9000&view=rev
Author: teo_sarca
Date: 2009-04-14 07:24:16 +0000 (Tue, 14 Apr 2009)
Log Message:
-----------
FR [ 2214883 ] Remove SQL code and Replace for Query
https://sourceforge.net/tracker/index.php?func=detail&aid=2214883&group_id=176962&atid=879335
Modified Paths:
--------------
trunk/base/src/org/compiere/model/MCharge.java
Revision: 9003
http://adempiere.svn.sourceforge.net/adempiere/?rev=9003&view=rev
Author: teo_sarca
Date: 2009-04-14 07:44:47 +0000 (Tue, 14 Apr 2009)
Log Message:
-----------
FR [ 2214883 ] Remove SQL code and Replace for Query
https://sourceforge.net/tracker/index.php?func=detail&aid=2214883&group_id=176962&atid=879335
Modified Paths:
--------------
trunk/base/src/org/compiere/model/MInvoiceTax.java
Revision: 9006
http://adempiere.svn.sourceforge.net/adempiere/?rev=9006&view=rev
Author: teo_sarca
Date: 2009-04-14 08:13:16 +0000 (Tue, 14 Apr 2009)
Log Message:
-----------
MProcess:
* FR [ 2214883 ] Remove SQL code and Replace for Query
* use saveEx instead of save - much more safer
* fix javadoc
Modified Paths:
--------------
trunk/base/src/org/compiere/model/MProcess.java
Revision: 9008
http://adempiere.svn.sourceforge.net/adempiere/?rev=9008&view=rev
Author: teo_sarca
Date: 2009-04-14 08:29:18 +0000 (Tue, 14 Apr 2009)
Log Message:
-----------
MSystem:
* FR [ 2214883 ] Remove SQL code and Replace for Query
https://sourceforge.net/tracker/index.php?func=detail&aid=2214883&group_id=176962&atid=879335
* use saveEx instead of save
Modified Paths:
--------------
trunk/base/src/org/compiere/model/MSystem.java
Revision: 9009
http://adempiere.svn.sourceforge.net/adempiere/?rev=9009&view=rev
Author: teo_sarca
Date: 2009-04-14 08:34:06 +0000 (Tue, 14 Apr 2009)
Log Message:
-----------
MTax:
FR [ 2214883 ] Remove SQL code and Replace for Query
https://sourceforge.net/tracker/index.php?func=detail&aid=2214883&group_id=176962&atid=879335
(integrate red1 changes)
Modified Paths:
--------------
trunk/base/src/org/compiere/model/MTax.java
Revision: 9011
http://adempiere.svn.sourceforge.net/adempiere/?rev=9011&view=rev
Author: teo_sarca
Date: 2009-04-14 09:21:23 +0000 (Tue, 14 Apr 2009)
Log Message:
-----------
FR [ 2214883 ] Remove SQL code and Replace for Query
https://sourceforge.net/tracker/index.php?func=detail&aid=2214883&group_id=176962&atid=879335
Modified Paths:
--------------
trunk/base/src/org/compiere/wf/MWFNode.java
trunk/base/src/org/compiere/wf/MWorkflow.java
Revision: 9012
http://adempiere.svn.sourceforge.net/adempiere/?rev=9012&view=rev
Author: teo_sarca
Date: 2009-04-14 10:06:08 +0000 (Tue, 14 Apr 2009)
Log Message:
-----------
Remove SQL code and Replace for Query
https://sourceforge.net/tracker/index.php?func=detail&aid=2214883&group_id=176962&atid=879335
Modified Paths:
--------------
trunk/base/src/org/compiere/model/MMovement.java
Revision: 9088
http://adempiere.svn.sourceforge.net/adempiere/?rev=9088&view=rev
Author: teo_sarca
Date: 2009-04-24 13:08:34 +0000 (Fri, 24 Apr 2009)
Log Message:
-----------
Remove SQL code and Replace for Query
https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2214883&group_id=176962
Introduce DB.getSQLValue*Ex methods
https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2448461&group_id=176962
* better exception handling - use saveEx
* introduced MInvoiceTest test case for changed methods
Modified Paths:
--------------
trunk/base/src/org/compiere/model/MInvoice.java
Added Paths:
-----------
trunk/extend/src/test/functional/MInvoiceTest.java
Revision: 9120
http://adempiere.svn.sourceforge.net/adempiere/?rev=9120&view=rev
Author: teo_sarca
Date: 2009-04-27 10:07:47 +0000 (Mon, 27 Apr 2009)
Log Message:
-----------
org.compiere.wf - Workflow Engine :
* Remove SQL code and Replace for Query
https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2214883&group_id=176962
* use DB.getSQLValue*Ex methods
* add WorkflowTest JUnit Test Case
Modified Paths:
--------------
trunk/base/src/org/compiere/wf/MWFActivity.java
trunk/base/src/org/compiere/wf/MWFEventAudit.java
trunk/base/src/org/compiere/wf/MWFNode.java
trunk/base/src/org/compiere/wf/MWFNodeNext.java
trunk/base/src/org/compiere/wf/MWFNodePara.java
trunk/base/src/org/compiere/wf/MWFProcess.java
trunk/base/src/org/compiere/wf/MWorkflow.java
trunk/base/src/org/compiere/wf/MWorkflowProcessor.java
trunk/base/src/org/compiere/wf/WFProcessManage.java
Added Paths:
-----------
trunk/extend/src/test/functional/WorkflowTest.java
Hi Red1!
I have a small comment regarding changes from M_Element class. There is much better to use firstOnly() method instead of first() then fetching the list and then checking if the list has only one element.
WDYT?
PS: Carlos, i know that the adviced way of writing comments is on trackers but this is a long term tracker where everybody is working & updating so i doubt that someone is checking it. So in this case, this approach is much more efficient ;)
Sorry, previous comment was added by Teo Sarca via mail list.
Redhuan answered:
Teo Sarca wrote:
> Hi Red1!
>
> I have a small comment regarding changes from M_Element class. There is much better to use firstOnly() method instead of first() then fetching the list and then checking if the list has only one element.
> WDYT?
>
> PS: Carlos, i know that the adviced way of writing comments is on trackers but this is a long term tracker where everybody is working & updating so i doubt that someone is checking it. So in this case, this approach is much more efficient ;)
I think ppl will check the tracker when it is updated via email list track monitoring.
I will follow Teo's advice and see about firstOnly() if it fulfills the code needs.
Thanks Teo.
red1
Victor added:
Hi Red1
My comment I think that Is very important write a test case to corroborate that all work as before.
Victor Perez
www.e-evolution.com
Teo added:
Agree with you Victor.
Red1 can you help us with a test case ;) ?
... something similar with http://adempiere.svn.sourceforge.net/svnroot/adempiere/trunk/extend/src/test/functional/MRefListTest.java