/** * Create a shell object and assign its id field. */ private Object createForeignShell(Object val, ObjectCache objectCache) throws SQLException { Object foreignObject = foreignTableInfo.createObject(); foreignIdField.assignField(foreignObject, val, false, objectCache); return foreignObject; }
@Override public T mapRow(String[] columnNames, String[] resultColumns) throws SQLException { // create our object T rowObj = tableInfo.createObject(); for (int i = 0; i < columnNames.length; i++) { // sanity check, prolly will never happen but let's be careful out there if (i >= resultColumns.length) { continue; } // run through and convert each field FieldType fieldType = tableInfo.getFieldTypeByColumnName(columnNames[i]); Object fieldObj = fieldType.convertStringToJavaField(resultColumns[i], i); // assign it to the row object fieldType.assignField(rowObj, fieldObj, false, null); } return rowObj; } }
T instance = tableInfo.createObject();