Multi-key lookup

This topic has 2 voices, contains 1 reply, and was last updated by  Dele Taylor 177 days ago.

Viewing 2 posts - 1 through 2 (of 2 total)
Author Posts
Author Posts
November 18, 2011 at 3:36 PM #351

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?

November 24, 2011 at 5:14 AM #352

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

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.