@RequiresSession
  public List<ServiceComponentVersionEntity> findVersions(long clusterId, String serviceName,
      String componentName) {
    EntityManager entityManager = entityManagerProvider.get();
    TypedQuery<ServiceComponentVersionEntity> query = entityManager.createNamedQuery(
        "ServiceComponentVersionEntity.findByComponent", ServiceComponentVersionEntity.class);

    query.setParameter("clusterId", clusterId);
    query.setParameter("serviceName", serviceName);
    query.setParameter("componentName", componentName);

    return daoUtils.selectList(query);
  }
@param clusterId     the cluster id
@param serviceName   the service name
@param componentName the component name
@return the list of repository versions for a component
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java