Menu

#557 Remove SQL code and Replace for Query

Core
open
3
2010-03-16
2008-11-01
No

Is very important for implement in the future a Standard Persistence remove all SQL code.

Kind regards
Victor Perez
www.e-evolution.com

Discussion

1 2 3 4 > >> (Page 1 of 4)
  • Victor Perez Juarez

    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

     
  • Trifon (An ADempiere founder)

    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.

     
  • Victor Perez Juarez

    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

     
  • Redhuan D. Oon

    Redhuan D. Oon - 2008-11-03

    Modified Paths:
    --------------
    branches/stable/base/src/org/compiere/model/MJournal.java
    branches/stable/base/src/org/compiere/model/MAlert.java

    with everyone's help :-)

     
  • Carlos Ruiz

    Carlos Ruiz - 2008-11-04

    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

     
  • Redhuan D. Oon

    Redhuan D. Oon - 2008-11-09

    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

     
  • Redhuan D. Oon

    Redhuan D. Oon - 2008-11-12

    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)
    {

     
  • Redhuan D. Oon

    Redhuan D. Oon - 2008-11-12

    got some typo mistake the last snippet. it should be:

    sqlBuffer.append(" AND AD_Client_ID="+Env.getAD_Client_ID(ctx));

     
  • Teo Sarca

    Teo Sarca - 2009-04-14

    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

     
  • Teo Sarca

    Teo Sarca - 2009-04-27

    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

     
  • Carlos Ruiz

    Carlos Ruiz - 2009-07-15

    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 ;)

     
  • Carlos Ruiz

    Carlos Ruiz - 2009-07-15

    Sorry, previous comment was added by Teo Sarca via mail list.

     
  • Carlos Ruiz

    Carlos Ruiz - 2009-07-15

    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

     
  • Carlos Ruiz

    Carlos Ruiz - 2009-07-15

    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

     
1 2 3 4 > >> (Page 1 of 4)

Log in to post a comment.