@RequiresSession
  public UpgradeGroupEntity findUpgradeGroup(Long groupId) {

    TypedQuery<UpgradeGroupEntity> query = entityManagerProvider.get().createQuery(
        "SELECT p FROM UpgradeGroupEntity p WHERE p.upgradeGroupId = :groupId", UpgradeGroupEntity.class);
    query.setParameter("groupId", groupId);

    return daoUtils.selectSingle(query);
  }
@param groupId the group id
@return the group, or {@code null} if not found
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/UpgradeDAO.java