@RequiresSession
  public StackEntity find(String stackName, String stackVersion) {
    TypedQuery<StackEntity> query = entityManagerProvider.get().createNamedQuery(
        "StackEntity.findByNameAndVersion", StackEntity.class);

    query.setParameter("stackName", stackName);
    query.setParameter("stackVersion", stackVersion);

    return daoUtils.selectOne(query);
  }
Gets the stack that matches the specified name and version.

@return the stack matching the specified name and version or {@code null}
        if none.
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/StackDAO.java