Ignore:
Timestamp:
Mar 20, 2012, 2:40:52 PM (13 years ago)
Author:
fmguler
Message:

Refs #7 - Implemented orderAsc and orderDesc methods of Criteria. Have been testing these for a while, no problem so far. Added BigDecimal to db classes (Numeric db type). If the column name is "order" it is escaped while insert/update. (This should be done for all db keywords). Fixed missing mapping of one to many assc. (lists) of many to one (object) assc (obj.obj.list).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/fmgVen/src/com/fmguler/ven/QueryGenerator.java

    r32 r37  
    2121import com.fmguler.ven.util.VenList; 
    2222import java.beans.PropertyDescriptor; 
     23import java.math.BigDecimal; 
    2324import java.util.Date; 
    2425import java.util.HashSet; 
     
    4748        this.dbClasses.add(Double.class); 
    4849        this.dbClasses.add(Boolean.class); 
     50        this.dbClasses.add(BigDecimal.class); 
    4951    } 
    5052 
     
    9193            //if (fieldName.equals("id")) continue; //remove if it does not break the sequence 
    9294            if (dbClasses.contains(fieldClass)) { //direct database field (Integer,String,Date, etc) 
    93                 query.append(columnName); 
     95                query.append(columnName.equals("order")?"\"order\"":columnName); 
    9496                query.append(","); 
    9597                values.append(":").append(fieldName); 
     
    129131            String fieldName = pdArr[i].getName(); //field name 
    130132            if (dbClasses.contains(fieldClass)) { //direct database field (Integer,String,Date, etc) 
    131                 query.append(columnName).append("=:").append(fieldName); 
     133                query.append(columnName.equals("order")?"\"order\"":columnName).append("=:").append(fieldName); 
    132134                query.append(","); 
    133135            } 
Note: See TracChangeset for help on using the changeset viewer.