Skip to content

Errors_CSFM_GETTER_NOT_FOUND

Arnaud Roger edited this page Jul 15, 2019 · 12 revisions

Why ?

When mapping from a source - ie. ResultSet - to an object sfm could not find a getter that would return the type of the property.

Are you trying to map to an element of List?

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")....

Then what?

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

More details

PS : what is CSFM - Constant Source Field Mapper, ie ResultSet to T

Clone this wiki locally