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
Date Sat, 27 Nov 2004 14:49:53 GMT
brj         2004/11/27 06:49:53

  Modified:    src/java/org/apache/ojb/broker/accesslayer/sql
                        SqlSelectStatement.java
  Log:
  fixed some problems in quoting
  
  Revision  Changes    Path
  1.34      +10 -10    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.33
  retrieving revision 1.34
  diff -u -r1.33 -r1.34
  --- SqlSelectStatement.java	22 Nov 2004 20:55:23 -0000	1.33
  +++ SqlSelectStatement.java	27 Nov 2004 14:49:53 -0000	1.34
  @@ -247,7 +247,8 @@
       private void appendSuperClassJoin(ClassDescriptor cld, ClassDescriptor cldSuper, StringBuffer
stmt,
               StringBuffer where)
       {
  -        stmt.append(",").append(cldSuper.getFullTableName());
  +        stmt.append(",");
  +        appendTable(cldSuper, stmt);
           if (where != null && where.length() > 0)
           {
               where.append(" AND ");
  @@ -256,14 +257,13 @@
           // TODO: do not use the superclassfield anymore, just assume that the id is the
same in both tables - @see PBroker.storeToDb
           int superFieldRef = cld.getSuperClassFieldRef();
           FieldDescriptor refField = cld.getFieldDescriptorByIndex(superFieldRef);
  -        where.append(cldSuper.getFullTableName())
  -        	.append(".")
  -        	.append(cldSuper.getAutoIncrementFields()[0].getColumnName())
  -        	.append(" = ")
  -        	.append(cld.getFullTableName())
  -        	.append(".")
  -        	.append(refField.getColumnName());
  -
  +        appendTable(cldSuper, where);
  +        where.append(".");
  +        appendField(cldSuper.getAutoIncrementFields()[0], where);
  +    	where.append(" = ");
  +        appendTable(cld, where);
  +        where.append(".");
  +        appendField(refField, where);
       }
   
       private void appendSuperClassColumns(ClassDescriptor cldSub, ClassDescriptor cldSuper,
StringBuffer buf)
  
  
  

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