EntityManager em = null;
try {
em = AppCatalogJPAUtils.getEntityManager();
em.getTransaction().begin();
Query q;
AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GLOBUS_SUBMISSION);
List results;
if (fieldName.equals(GlobusJobSubmissionConstants.SUBMISSION_ID)) {
generator.setParameter(GlobusJobSubmissionConstants.SUBMISSION_ID, value);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
GlobusJobSubmission globusJobSubmission = (GlobusJobSubmission) result;
globusSubmissionResourceIDs.add(globusJobSubmission.getSubmissionID());
}
}
} else if (fieldName.equals(GlobusJobSubmissionConstants.GLOBUS_GATEKEEPER_EP)) {
generator.setParameter(GlobusJobSubmissionConstants.GLOBUS_GATEKEEPER_EP, value);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
GlobusJobSubmission globusJobSubmission = (GlobusJobSubmission) result;
globusSubmissionResourceIDs.add(globusJobSubmission.getSubmissionID());
}
}
}
else if (fieldName.equals(GlobusJobSubmissionConstants.SECURITY_PROTOCAL)) {
generator.setParameter(GlobusJobSubmissionConstants.SECURITY_PROTOCAL, value);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
GlobusJobSubmission globusJobSubmission = (GlobusJobSubmission) result;
globusSubmissionResourceIDs.add(globusJobSubmission.getSubmissionID());
}
}
} else if (fieldName.equals(GlobusJobSubmissionConstants.RESOURCE_JOB_MANAGER)) {
generator.setParameter(GlobusJobSubmissionConstants.RESOURCE_JOB_MANAGER, value);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
GlobusJobSubmission globusJobSubmission = (GlobusJobSubmission) result;
globusSubmissionResourceIDs.add(globusJobSubmission.getSubmissionID());