EntityManager em = null;
try {
em = AppCatalogJPAUtils.getEntityManager();
em.getTransaction().begin();
Query q;
AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(LIBRARY_PREPAND_PATH);
List results;
if (fieldName.equals(LibraryPrepandPathConstants.DEPLOYMENT_ID)) {
generator.setParameter(LibraryPrepandPathConstants.DEPLOYMENT_ID, value);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
LibraryPrepandPath prepandPath = (LibraryPrepandPath) result;
LibraryPrepandPathResource resource =
(LibraryPrepandPathResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.LIBRARY_PREPAND_PATH, prepandPath);
libPrepPathList.add(resource);
}
}
} else if (fieldName.equals(LibraryPrepandPathConstants.NAME)) {
generator.setParameter(LibraryPrepandPathConstants.NAME, value);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
LibraryPrepandPath prepandPath = (LibraryPrepandPath) result;
LibraryPrepandPathResource resource =