@Override public ProjectComponent getProjectComponent(final Long projectComponentId) { validateId(projectComponentId); GenericValue gv = findComponentGV(FIELD_ID, projectComponentId); if (gv == null) { return null; } else { return Entity.PROJECT_COMPONENT.build(gv); } }
/** * Retrieve the MutableProjectComponent with the specified ID. An EntityNotFoundException is thrown if the component * is not found. * * @param id component ID to search for * @return MutableProjectComponent component with the specified ID * @throws EntityNotFoundException if the component is not found */ public MutableProjectComponent find(Long id) throws EntityNotFoundException { validateId(id); GenericValue componentGV = findComponentGV(FIELD_ID, id); if (componentGV == null) { throw new EntityNotFoundException("Component with ID = '" + id + "' does not exist."); } else { return getComponentConverter().convertToComponent(componentGV); } }