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 SqlInsertStatement.java SqlUpdateStatement.java
Date Mon, 21 Apr 2003 07:57:10 GMT
brj         2003/04/21 00:57:10

  Modified:    src/java/org/apache/ojb/broker/accesslayer/sql
                        SqlInsertStatement.java SqlUpdateStatement.java
  Log:
  support for read-only fields
  
  Revision  Changes    Path
  1.4       +10 -10    db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlInsertStatement.java
  
  Index: SqlInsertStatement.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlInsertStatement.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SqlInsertStatement.java	8 Oct 2002 13:20:18 -0000	1.3
  +++ SqlInsertStatement.java	21 Apr 2003 07:57:10 -0000	1.4
  @@ -100,18 +100,18 @@
   
       private List appendListOfColumns(ClassDescriptor cld, StringBuffer buf)
       {
  -        FieldDescriptor[] fieldDescriptors = cld.getFieldDescriptions();
  +        FieldDescriptor[] fields = cld.getAllRwFields();
   
           ArrayList columnList = new ArrayList();
   
  -        for (int i = 0; i < fieldDescriptors.length; i++)
  +        for (int i = 0; i < fields.length; i++)
           {
               if (i > 0)
               {
                   buf.append(",");
               }
  -            buf.append(fieldDescriptors[i].getColumnName());
  -            columnList.add(fieldDescriptors[i].getAttributeName());
  +            buf.append(fields[i].getColumnName());
  +            columnList.add(fields[i].getAttributeName());
           }
           return columnList;
       }
  @@ -123,23 +123,23 @@
        */
       private void appendListOfValues(ClassDescriptor cld, StringBuffer stmt)
       {
  -        FieldDescriptor[] fields = cld.getFieldDescriptions();
  +        FieldDescriptor[] fields = cld.getAllRwFields();
   
           if (fields.length == 0)
           {
  -            return ;
  +            return;
           }    
   
  -        stmt.append(" VALUES ( ");
  +        stmt.append(" VALUES (");
           for (int i = 0; i < fields.length; i++)
           {
               stmt.append("?");
               if (i < fields.length - 1)
               {
  -                stmt.append(", ");
  +                stmt.append(",");
               }
           }
  -        stmt.append(" ) ");
  +        stmt.append(") ");
       }
       
   }
  
  
  
  1.4       +3 -3      db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlUpdateStatement.java
  
  Index: SqlUpdateStatement.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/accesslayer/sql/SqlUpdateStatement.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SqlUpdateStatement.java	8 Oct 2002 13:20:18 -0000	1.3
  +++ SqlUpdateStatement.java	21 Apr 2003 07:57:10 -0000	1.4
  @@ -83,7 +83,7 @@
   	 */
   	private void appendSetClause(ClassDescriptor cld, StringBuffer stmt)
   	{
  -		FieldDescriptor[] fields = cld.getNonPkFields();
  +		FieldDescriptor[] fields = cld.getNonPkRwFields();
   
   		if (fields.length == 0)
   		{
  @@ -97,7 +97,7 @@
   			stmt.append("=?");
   			if (i < fields.length - 1)
   			{
  -				stmt.append(", ");
  +				stmt.append(",");
   			}
   		}
   	}
  
  
  

Mime
View raw message