@RequiresSession
  public List<HostComponentStateEntity> findByService(String serviceName) {
    final TypedQuery<HostComponentStateEntity> query = entityManagerProvider.get().createNamedQuery("HostComponentStateEntity.findByService", HostComponentStateEntity.class);
    query.setParameter("serviceName", serviceName);

    return daoUtils.selectList(query);
  }
Retrieve all of the Host Component States for the given service.

@param serviceName Service Name
@return Return all of the Host Component States that match the criteria.
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostComponentStateDAO.java