EntityManager em = null;
try {
em = AppCatalogJPAUtils.getEntityManager();
em.getTransaction().begin();
Query q;
AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GSISSH_POSTJOBCOMMAND);
List results;
if (fieldName.equals(GSISSHPostJobCommandConstants.SUBMISSION_ID)) {
generator.setParameter(GSISSHPostJobCommandConstants.SUBMISSION_ID, value);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
GSISSHPostJobCommand gsisshPostJobCommand = (GSISSHPostJobCommand) result;
GSISSHPostJobCommandResource gsisshPostJobCommandResource =
(GSISSHPostJobCommandResource) AppCatalogJPAUtils.getResource(
AppCatalogResourceType.GSISSH_POSTJOBCOMMAND, gsisshPostJobCommand);
gsiSSHPostJobCommandResources.add(gsisshPostJobCommandResource);
}
}
} else if (fieldName.equals(GSISSHPostJobCommandConstants.COMMAND)) {
generator.setParameter(GSISSHPostJobCommandConstants.COMMAND, value);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
GSISSHPostJobCommand gsisshPostJobCommand = (GSISSHPostJobCommand) result;
GSISSHPostJobCommandResource gsisshPostJobCommandResource =