@RequiresSession
  public List<ClusterConfigEntity> getLatestConfigurationsWithTypes(long clusterId, StackId stackId, Collection<String> configTypes) {
    StackEntity stackEntity = stackDAO.find(stackId.getStackName(), stackId.getStackVersion());
    if (configTypes.isEmpty()) {
      return Collections.emptyList();
    }
    return daoUtils.selectList(
      entityManagerProvider.get()
      .createNamedQuery("ClusterConfigEntity.findLatestConfigsByStackWithTypes", ClusterConfigEntity.class)
      .setParameter("clusterId", clusterId)
      .setParameter("stack", stackEntity)
      .setParameter("types", configTypes));
  }
Gets the latest configurations for a given stack with any of the given config types.
This method does not take into account the configuration being enabled.
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ClusterDAO.java