Class type = t.getColumnType(keyField);
if ( type == null )
return -1;
// get the index and perform the lookup
Index index = t.index(keyField);
if ( type == int.class ) {
return index.get(rset.getInt(keyField));
} else if ( type == long.class ) {
return index.get(rset.getLong(keyField));
} else if ( type == float.class ) {
return index.get(rset.getFloat(keyField));
} else if ( type == double.class ) {
return index.get(rset.getDouble(keyField));
} else if ( !type.isPrimitive() ) {
return index.get(rset.getObject(keyField));
} else {
return -1;
}
}