@RequiresSession
  public HostEntity findByName(String hostName) {
    TypedQuery<HostEntity> query = entityManagerProvider.get().createNamedQuery(
        "HostEntity.findByHostName", HostEntity.class);
    query.setParameter("hostName", hostName);
    try {
      return query.getSingleResult();
    } catch (NoResultException ignored) {
      return null;
    }
  }
Looks for Host by ID
@param hostId ID of Host
@return Found entity or NULL
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostDAO.java