Changeset 37 for trunk/fmgVen/src/com/fmguler/ven/QueryMapper.java
- Timestamp:
- Mar 20, 2012, 2:40:52 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/fmgVen/src/com/fmguler/ven/QueryMapper.java
r35 r37 21 21 import com.fmguler.ven.util.VenList; 22 22 import java.beans.PropertyDescriptor; 23 import java.math.BigDecimal; 23 24 import java.sql.ResultSet; 24 25 import java.sql.SQLException; … … 56 57 this.dbClasses.add(Double.class); 57 58 this.dbClasses.add(Boolean.class); 59 this.dbClasses.add(BigDecimal.class); 58 60 } 59 61 … … 125 127 if (debug) System.out.println("--field not found: " + columnName); 126 128 } 129 continue; //if this is a primitive property, it cannot be an object or list 127 130 } 128 131 129 132 //many to one association (object property) 130 if ( map &&fieldClass.getPackage() != null && domainPackages.contains(fieldClass.getPackage().getName())) {133 if (fieldClass.getPackage() != null && domainPackages.contains(fieldClass.getPackage().getName())) { 131 134 if (columns.contains(columnName + "_id")) { 132 135 if (debug) System.out.println(">>object is found " + columnName); 133 136 List list = new ArrayList(1); //we know there will be single result 137 if (!map) list.add(fieldValue); //otherwise we cannot catch one to many assc. (lists) of many to one (object) assc. 134 138 mapRecursively(rs, columns, columnName, fieldClass, list); 135 139 if (list.size() > 0) wr.setPropertyValue(pd.getName(), list.get(0)); … … 151 155 } 152 156 } catch (Exception ex) { 157 System.out.println("Ven - error while mapping row, table: " + tableName + " object class: " + objectClass + " error: " + ex.getMessage()); 153 158 if (debug) { 154 System.out.println("Ven - error while mapping row; ");155 159 ex.printStackTrace(); 156 160 }
Note: See TracChangeset
for help on using the changeset viewer.