
|
Can the JdbcLookup and LoopupTransformer handle multi-key lookups? Seems like the examples only show a single field to be matched…
Also can more than one value be retrieved?
|
 Dele Taylor
|
Yes, multi-key lookups are supported and retrieving multiple values is also supported.
For multiple keys, update your JdbcLookup query to accept multiple parameters in the where clause, then add them to the LookupTransformer’s FieldList.
For multiple values, update your JdbcLookup query to select multiple fields.
Something like:
Lookup lookup = new JdbcLookup(connection,
"SELECT a, b, c FROM some_table WHERE d=? and e=?");
transformingReader.add(new LookupTransformer(new FieldList("Rating", "Country"), lookup));
Cheers,
Dele
|