// detect if returnTypeClass has a constructor that takes a ResultSet, if so, our job couldn't be easier...
booleanresultSetConstructor=false;
Constructor<T>constructor=null;
@ -114,17 +120,12 @@ public class RowToObjectMapper<T> extends RowMapper {
if(!constructor.isAccessible())
constructor.setAccessible(true);
}catch(Throwablee1){
thrownewMapperException("Exception when trying to get constructor for : "+returnTypeClass.getName()+" Must have default no-arg constructor or one that takes a single ResultSet.",e1);
if(_columnCount!=1)// if column count is only 1, it might map directly to a type like a Long or something
thrownewMapperException("Exception when trying to get constructor for : "+returnTypeClass.getName()+" Must have default no-arg constructor or one that takes a single ResultSet.",e1);
@ -218,6 +219,8 @@ public class RowToObjectMapper<T> extends RowMapper {
try{
resultObject=constructor.newInstance();
}catch(Throwablee){
if(constructor==null)// then this is a different error
thrownewMapperException("Exception when trying to get constructor for : "+_returnTypeClass.getName()+" Must have default no-arg constructor or one that takes a single ResultSet.",e);
thrownewMapperException(e.getClass().getName()+" when trying to create instance of : "
Assert.assertEquals(arrayMap.toArray(newMap[arrayMap.size()]),qm.toArrayMap("SELECT first_name, last_name FROM person WHERE person_no < 4",arrayMap.get(0).getClass(),String.class));