Hi,
I have created a custom java transformer and want to read all the data from a look up table.
In the graph, I first populate look up table from an excel sheet. It has 3 records and I confirmed that all the 3 records exists in look up table. However in my java code, I can only see one record when I try to read it.
The Key for look up table is called “Key” field and has 0 as value in all 3 records. Here is my Java code
private void loadAllLookUpRecords() {
try {
System.out.println("Loading loadAllLookUpRecords");
LookupTable lt;
lt = getGraph().getLookupTable(LOOKUP_TABLE_ID);
DataRecord patternRecord = DataRecordFactory.newRecord(lt
.getMetadata());
patternRecord.getField(0).setValue(0);
String[] lookupFields = { "Key" };
RecordKey recordKey = new RecordKey(lookupFields, lt.getMetadata());
Lookup lookup;
lookup = lt.createLookup(recordKey, patternRecord);
lookup.seek();
System.out.println("lookup Size :: " + lookup.getNumFound());
while (lookup.hasNext()) {
System.out.println("Look up records Found");
DataRecord record = lookup.next();
allLookupDataRecords.add(record);
}
System.out.println("AllLookUpRecords Size :: " + allLookupDataRecords.size());
} catch (Exception ex) {
throw new JetelRuntimeException(ex);
}
}
lookup.getNumFound() always returns 1 record. I will really appreciate if someone can point in right direction to load all data from lookup table. Thanks, Paresh