EntityManager em = null;
try {
em = AppCatalogJPAUtils.getEntityManager();
em.getTransaction().begin();
Query q;
AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GSISSH_PREJOBCOMMAND);
List results;
if (fieldName.equals(GSISSHPreJobCommandConstants.SUBMISSION_ID)) {
generator.setParameter(GSISSHPreJobCommandConstants.SUBMISSION_ID, value);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
GSISSHPreJobCommand gsisshPreJobCommand = (GSISSHPreJobCommand) result;
GSISSHPreJobCommandResource gsisshPreJobCommandResource =
(GSISSHPreJobCommandResource) AppCatalogJPAUtils.getResource(
AppCatalogResourceType.GSISSH_PREJOBCOMMAND, gsisshPreJobCommand);
gsiSSHPreJobResources.add(gsisshPreJobCommandResource);
}
}
} else if (fieldName.equals(GSISSHPreJobCommandConstants.COMMAND)) {
generator.setParameter(GSISSHPreJobCommandConstants.COMMAND, value);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
GSISSHPreJobCommand gsisshPreJobCommand = (GSISSHPreJobCommand) result;
GSISSHPreJobCommandResource gsisshPreJobCommandResource =