@RequiresSession
  public List<HostRoleCommandEntity> findByHostId(Long hostId) {
    TypedQuery<HostRoleCommandEntity> query = entityManagerProvider.get().createNamedQuery(
        "HostRoleCommandEntity.findByHostId",
        HostRoleCommandEntity.class);

    query.setParameter("hostId", hostId);
    return daoUtils.selectList(query);
  }
Retrieves minimal host role command columns which are required to calculate stare state.
@param taskIds collection of host role commands to process.
@return minimized host role command entities.
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/HostRoleCommandDAO.java