public Map getLookupMap() {
final String methodName = " :: getLookupMap - ";
logger.info(methodName + "START");
String lookupName = "Lookup.MySyn.userType";
Map lookupMap = new HashMap();
tcLookupOperationsIntf lookupService =
Platform.getService(tcLookupOperationsIntf.class);
try {
tcResultSet resultSet = lookupService.getLookupValues(lookupName);
String codeKey, meaningValue;
for (int i = 0; i < resultSet.getRowCount(); i++) {
resultSet.goToRow(i);
codeKey =
resultSet.getStringValue("Lookup Definition.Lookup Code Information.Code Key");
meaningValue =
resultSet.getStringValue("Lookup Definition.Lookup Code Information.Decode");
lookupMap.put(codeKey, meaningValue);
//logger.info(methodName + " \nLookup Key: [" + codeKey +
// "], Lookup Value:[" + meaningValue + "])");
}
} catch (tcAPIException e) {
logger.severe(methodName +
"Exception occured while reading lookup " +
e.getMessage());
e.printStackTrace();
} catch (tcInvalidLookupException e) {
logger.severe(methodName +
"Exception occured while reading lookup " +
e.getMessage());
e.printStackTrace();
} catch (tcColumnNotFoundException e) {
logger.severe(methodName +
"Exception occured while reading lookup " +
e.getMessage());
e.printStackTrace();
}
logger.info(methodName + "END");
return lookupMap;
}
final String methodName = " :: getLookupMap - ";
logger.info(methodName + "START");
String lookupName = "Lookup.MySyn.userType";
Map
tcLookupOperationsIntf lookupService =
Platform.getService(tcLookupOperationsIntf.class);
try {
tcResultSet resultSet = lookupService.getLookupValues(lookupName);
String codeKey, meaningValue;
for (int i = 0; i < resultSet.getRowCount(); i++) {
resultSet.goToRow(i);
codeKey =
resultSet.getStringValue("Lookup Definition.Lookup Code Information.Code Key");
meaningValue =
resultSet.getStringValue("Lookup Definition.Lookup Code Information.Decode");
lookupMap.put(codeKey, meaningValue);
//logger.info(methodName + " \nLookup Key: [" + codeKey +
// "], Lookup Value:[" + meaningValue + "])");
}
} catch (tcAPIException e) {
logger.severe(methodName +
"Exception occured while reading lookup " +
e.getMessage());
e.printStackTrace();
} catch (tcInvalidLookupException e) {
logger.severe(methodName +
"Exception occured while reading lookup " +
e.getMessage());
e.printStackTrace();
} catch (tcColumnNotFoundException e) {
logger.severe(methodName +
"Exception occured while reading lookup " +
e.getMessage());
e.printStackTrace();
}
logger.info(methodName + "END");
return lookupMap;
}
No comments:
Post a Comment