-
Notifications
You must be signed in to change notification settings - Fork 76
Errors_CSFM_GETTER_NOT_FOUND
Arnaud Roger edited this page Jul 15, 2019
·
12 revisions
When mapping from a source - ie. ResultSet - to an object sfm could not find a getter that would return the type of the property.
class Foo {
List<String> bars;
}
failed on column "bars" with an error message like
Could not find getter for ColumnKey [columnName=bars, columnIndex=1, sqlType=-99999] type ParameterizedTypeImpl{rawType=interface java.util.List, types=[class java.lang.String]} path bars
you will need to rename the column either in the query or by adding an alias to force sfm to map the column to the underlying element.
the column name needs to be bars_val
, it does not have to be val
can be anything of your liking.
select bars as bars_val
or
JdbcMapperFactory.newInstance().addAlias("bars", "bars_val")....
You will need to provide a custom getter to the framework that will build the specific type from the source object. you can also provide a getter factory that will build a getter based on the field key.
see Docs
PS : what is CSFM - Constant Source Field Mapper, ie ResultSet to T