@RequiresSession
  public ServiceComponentVersionEntity findVersion(long clusterId, String serviceName,
      String componentName, String version) {

    EntityManager entityManager = entityManagerProvider.get();
    TypedQuery<ServiceComponentVersionEntity> query = entityManager.createNamedQuery(
        "ServiceComponentVersionEntity.findByComponentAndVersion", ServiceComponentVersionEntity.class);

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

    return daoUtils.selectSingle(query);
  }
Gets a specific version for a component
@param clusterId     the cluster id
@param serviceName   the service name
@param componentName the component name
@param version       the component version to find
@return the version entity, or {@code null} if not found
ambari-server/src/main/java/org/apache/ambari/server/orm/dao/ServiceComponentDesiredStateDAO.java