generator.setParameter(ComputeResourcePreferenceConstants.RESOURCE_ID, value);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
ComputeResourcePreference preference = (ComputeResourcePreference) result;
if (preference.getComputeHostResource()!=null) {
ComputeHostPreferenceResource preferenceResource = (ComputeHostPreferenceResource) AppCatalogJPAUtils
.getResource(
AppCatalogResourceType.COMPUTE_RESOURCE_PREFERENCE,
preference);
preferenceResourceList.add(preferenceResource);
}
}
}
} else if (fieldName.equals(ComputeResourcePreferenceConstants.GATEWAY_ID)) {
generator.setParameter(ComputeResourcePreferenceConstants.GATEWAY_ID, value);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
ComputeResourcePreference preference = (ComputeResourcePreference) result;
if (preference.getComputeHostResource()!=null) {
ComputeHostPreferenceResource preferenceResource =
(ComputeHostPreferenceResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.COMPUTE_RESOURCE_PREFERENCE, preference);
preferenceResourceList.add(preferenceResource);
}
}
}
} else if (fieldName.equals(ComputeResourcePreferenceConstants.PREFERED_JOB_SUB_PROTOCOL)) {
generator.setParameter(ComputeResourcePreferenceConstants.PREFERED_JOB_SUB_PROTOCOL, value);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
ComputeResourcePreference preference = (ComputeResourcePreference) result;
if (preference.getComputeHostResource()!=null) {
ComputeHostPreferenceResource preferenceResource = (ComputeHostPreferenceResource) AppCatalogJPAUtils
.getResource(
AppCatalogResourceType.COMPUTE_RESOURCE_PREFERENCE,
preference);
preferenceResourceList.add(preferenceResource);
}
}
}
} else if (fieldName.equals(ComputeResourcePreferenceConstants.PREFERED_DATA_MOVE_PROTOCOL)) {
generator.setParameter(ComputeResourcePreferenceConstants.PREFERED_DATA_MOVE_PROTOCOL, value);
q = generator.selectQuery(em);
results = q.getResultList();
if (results.size() != 0) {
for (Object result : results) {
ComputeResourcePreference preference = (ComputeResourcePreference) result;
if (preference.getResourceId()!=null) {
ComputeHostPreferenceResource preferenceResource = (ComputeHostPreferenceResource) AppCatalogJPAUtils
.getResource(
AppCatalogResourceType.COMPUTE_RESOURCE_PREFERENCE,
preference);
preferenceResourceList.add(preferenceResource);