docs: private Criteria buildCriteria(QueryModel queryModel) {
          Criteria criteria = getCurrentSession().createCriteria(persistentClass);
  
          if (queryModel.getConditions() != null) {
              for (Condition condition : queryModel.getConditions()) {
                  criteria.add((Criterion) condition.getConstraint());
              }
          }
  
          for (Map.Entry<String, List<Condition>> associationCriteriaEntry : queryModel.getAssociationConditions().entrySet()) {
              Criteria associationCriteria = criteria.createCriteria(associationCriteriaEntry.getKey());
  
              criteria.setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY);
  
              for (Condition condition : associationCriteriaEntry.getValue()) {
                  associationCriteria.add((Criterion) condition.getConstraint());
              }
          }
  
          if (queryModel.getProjection() != null) {
              ProjectionList projectionList = Projections.projectionList();
  
              projectionList.add((org.hibernate.criterion.Projection) queryModel.getProjection().getDetails());
  
              criteria.setProjection(projectionList);
          }
  
          return criteria;
      }