Hi,
I have a quite simple Continent table containing id, code and name columns.
I also have a Continent model class containing the same property with ordinary getters/setters following the bean specification.
For creating queries I'm using jOOQ for mapping I'm experimenting with the SimpleFlatMapper using ResultSets.
My code looks like:
JdbcMapper<Continent> continentJdbcMapper = JdbcMapperFactory
.newInstance()
.newBuilder(Continent.class)
.mapper();
ResultSet rs = jooqDslContext
.select(
CONTINENT.CODE,
.from(CONTINENT)
.where(CONTINENT.ID.eq(id))
.fetchResultSet();
Continent continent = continentJdbcMapper.map(rs);
The problem is all properties of the continent instance are null; so mapping did not work.
I changed my continentJdbcMapper to static mapping like:
JdbcMapper<Continent> continentJdbcMapper = JdbcMapperFactory
.newInstance()
.newBuilder(Continent.class)
.addMapping("id")
.addMapping("code")
.addMapping("name")
.mapper();
and then it works.
I would have expected that dynamic mapping should be working or am I missing something?
Cheers,
Marcel