db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql SqlSelectStatement.java SqlSelectByPkStatement.java SqlDeleteByQuery.java SqlQueryStatement.java
Date Thu, 22 Dec 2005 18:25:51 GMT
brj         2005/12/22 10:25:51

  Modified:    src/java/org/apache/ojb/broker/accesslayer/sql Tag:
                        OJB_1_0_RELEASE SqlSelectStatement.java
                        SqlSelectByPkStatement.java SqlDeleteByQuery.java
                        SqlQueryStatement.java
  Log:
  cache sql-string
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.22.2.8  +3 -3      db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectStatement.java
  
  Index: SqlSelectStatement.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectStatement.java,v
  retrieving revision 1.22.2.7
  retrieving revision 1.22.2.8
  diff -u -r1.22.2.7 -r1.22.2.8
  --- SqlSelectStatement.java	21 Dec 2005 22:23:44 -0000	1.22.2.7
  +++ SqlSelectStatement.java	22 Dec 2005 18:25:51 -0000	1.22.2.8
  @@ -262,9 +262,9 @@
       }
   
       /**
  -     * Answer the SELECT-Sql for the Statement
  +     * @see org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement#buildStatement()
        */
  -    public String getStatement()
  +    protected String buildStatement()
       {
           StringBuffer stmt = new StringBuffer(1024);
           Query query = getQuery();
  
  
  
  1.8.2.4   +1 -12     db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectByPkStatement.java
  
  Index: SqlSelectByPkStatement.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlSelectByPkStatement.java,v
  retrieving revision 1.8.2.3
  retrieving revision 1.8.2.4
  diff -u -r1.8.2.3 -r1.8.2.4
  --- SqlSelectByPkStatement.java	21 Dec 2005 22:23:44 -0000	1.8.2.3
  +++ SqlSelectByPkStatement.java	22 Dec 2005 18:25:51 -0000	1.8.2.4
  @@ -32,8 +32,6 @@
   
   public class SqlSelectByPkStatement extends SqlSelectStatement
   {
  -    private String sql;
  -
       /**
        * Constructor for SqlSelectByPkStatement.
        *
  @@ -62,13 +60,4 @@
           }
           return new QueryByCriteria(cld.getClassOfObject(), crit);
       }
  -
  -    public String getStatement()
  -    {
  -        if(sql == null)
  -        {
  -            sql = super.getStatement();
  -        }
  -        return sql;
  -    }
   }
  \ No newline at end of file
  
  
  
  1.15.2.2  +5 -5      db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlDeleteByQuery.java
  
  Index: SqlDeleteByQuery.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlDeleteByQuery.java,v
  retrieving revision 1.15.2.1
  retrieving revision 1.15.2.2
  diff -u -r1.15.2.1 -r1.15.2.2
  --- SqlDeleteByQuery.java	21 Dec 2005 22:23:44 -0000	1.15.2.1
  +++ SqlDeleteByQuery.java	22 Dec 2005 18:25:51 -0000	1.15.2.2
  @@ -41,10 +41,10 @@
   		super(pf, cld, query, logger);
   	}
   
  -	/**
  -	 * @see org.apache.ojb.broker.accesslayer.sql.SqlStatement#getStatement()
  -	 */
  -	public String getStatement()
  +    /**
  +     * @see org.apache.ojb.broker.accesslayer.sql.SqlQueryStatement#buildStatement()
  +     */
  +	protected String buildStatement()
   	{
   		StringBuffer stmt = new StringBuffer();
   		StringBuffer where = new StringBuffer();
  
  
  
  1.75.2.23 +18 -1     db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java
  
  Index: SqlQueryStatement.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlQueryStatement.java,v
  retrieving revision 1.75.2.22
  retrieving revision 1.75.2.23
  diff -u -r1.75.2.22 -r1.75.2.23
  --- SqlQueryStatement.java	21 Dec 2005 22:23:43 -0000	1.75.2.22
  +++ SqlQueryStatement.java	22 Dec 2005 18:25:51 -0000	1.75.2.23
  @@ -62,6 +62,7 @@
   {
       private static final String ALIAS_SEPARATOR = ".";
       private static final String M_N_ALIAS = "M_N";
  +    private String sql;
       
       private SqlQueryStatement m_parentStatement;
       /** the logger */
  @@ -1868,7 +1869,23 @@
       {
           return m_logger;
       }
  +    
  +    public String getStatement()
  +    {
  +        if(sql == null)
  +        {
  +            sql = buildStatement();
  +        }
  +        return sql;
  +    }
   
  +    /**
  +     * Build the SQL String.
  +     * @return SQL String
  +     */
  +    protected abstract String buildStatement();
  +    
  +    
       //-----------------------------------------------------------------
       // ------------------- Inner classes ------------------------------
       //-----------------------------------------------------------------
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message