Adds a projection that allows the criteria to return the distinct property count

@param propertyName The name of the property
@param alias The alias to use
186026
public org.grails.datastore.mapping.query.api.ProjectionList countDistinct(String propertyName, String alias) {
        final CountProjection proj = Projections.countDistinct(calculatePropertyName(propertyName));
        addProjectionToList(proj, alias);
        return this;
    }
176851
public org.grails.datastore.mapping.query.api.Criteria rlike(String propertyName, Object propertyValue) {
        if (!validateSimpleExpression()) {
            throwRuntimeException(new IllegalArgumentException("Call to [rlike] with propertyName [" +
                    propertyName + "] and value [" + propertyValue + "] not allowed here."));
        }

        propertyName = calculatePropertyName(propertyName);
        propertyValue = calculatePropertyValue(propertyValue);
        addToCriteria(new RlikeExpression(propertyName, propertyValue));
        return this;
    }
350
private void countPropertyReference(UsageStatistics usageStatistics,
			PropertyIdValue property, int count) {
		addPropertyCounters(usageStatistics, property);
		usageStatistics.propertyCountsReferences.put(property,
				usageStatistics.propertyCountsReferences.get(property) + count);
	}
286363
public org.grails.datastore.mapping.query.api.Criteria eqAll(String propertyName,
                                                                 @SuppressWarnings("rawtypes") QueryableCriteria propertyValue) {
        addToCriteria(Property.forName(propertyName).eqAll(convertToHibernateCriteria(propertyValue)));
        return this;
    }
268895
public void addProperty(String propertyName, Direction direction) {
        if (propertyName == null) {
            throw new IllegalArgumentException();
        }
        if (direction == null) {
            direction = Direction.UNSPECIFIED;
        }

        if (direction != Direction.UNSPECIFIED) {
            if (propertyName.length() > 0) {
                if (propertyName.charAt(0) == '-' || propertyName.charAt(0) == '+') {
                    // Overrule the direction.
                    propertyName = propertyName.substring(1);
                }
            }
            propertyName = direction.toCharacter() + propertyName;
        }

        mPropertyList.add(propertyName);
    }
528380
public void update(AliasDefinition newAliasDef) {
        assert m_aliasName.equals(newAliasDef.m_aliasName);
        assert m_tableName.equals(newAliasDef.m_tableName);
        
        // Currently, all we have to do is copy over the "expression" property.
        m_expression = newAliasDef.m_expression;
    }
1047524
protected void processAsPropertyNames(QualifiedName name, NameAcceptor acceptor) {
		String nameAsPropertyName = tryGetAsPropertyName(name.toString());
		if (nameAsPropertyName != null) {
			if (featureCall == null || featureCall instanceof XAssignment) {
				String aliasedSetter = "set" + nameAsPropertyName;
				acceptor.accept(aliasedSetter, 2);
			}
			if (!(featureCall instanceof XAssignment)) {
				if (featureCall == null || !getFeatureCall().isExplicitOperationCallOrBuilderSyntax()) {
					String aliasedGetter = "get" + nameAsPropertyName;
					acceptor.accept(aliasedGetter, 2);
					String aliasedBooleanGetter = "is" + nameAsPropertyName;
					acceptor.accept(aliasedBooleanGetter, 2);
				}
			}
		}
	}
987299
public boolean aliasExists(String alias) {
        try {
            final JestResult result = jestClient.execute(new GetSettings.Builder().addIndex(alias).build());
            return result.isSucceeded() && !Iterators.contains(result.getJsonObject().fieldNames(), alias);
        } catch (IOException e) {
            throw new ElasticsearchException("Couldn't check existence of alias " + alias, e);
        }
    }
452366
protected void addProperties(Root<T> root, CriteriaQuery<T> query, Set<String> properties) {
		
		// Ajout des ppt
		addProperties(root, properties);
		
		// On positionne le distict
		query.distinct(true);
	}
214102
public void setAlias(String alias)
	{
		m_alias = alias;
		String attributePath = (String)getAttribute();
		boolean allPathsAliased = true;
		m_userAlias = new UserAlias(alias, attributePath, allPathsAliased);
		
	}
1238426
private void addPropertyCounters(UsageStatistics usageStatistics,
			PropertyIdValue property) {
		if (!usageStatistics.propertyCountsMain.containsKey(property)) {
			usageStatistics.propertyCountsMain.put(property, 0);
			usageStatistics.propertyCountsQualifier.put(property, 0);
			usageStatistics.propertyCountsReferences.put(property, 0);
		}
	}
985768
public final void addTemplateAlias(final String alias, final String templateName) {
        Validate.notNull(alias, "Alias cannot be null");
        Validate.notNull(templateName, "Template name cannot be null");
        this.templateAliases.put(alias, templateName);
    }
595531
public void addEntity(String alias, String entityName) {
    EntityType entityType = Model.getType(entityName);
    if (null == entityType) { throw new RuntimeException("cannot find entity type for " + entityName); }
    entityTypes.put(alias, entityType);
  }
821603
protected String calculatePropertyName(String propertyName) {
        String lastAlias = getLastAlias();
        if (lastAlias != null) {
            return lastAlias +'.'+propertyName;
        }

        return propertyName;
    }
97384
public org.grails.datastore.mapping.query.api.ProjectionList property(String propertyName, String alias) {
        final PropertyProjection propertyProjection = Projections.property(calculatePropertyName(propertyName));
        addProjectionToList(propertyProjection, alias);
        return this;
    }
668446
public static boolean isIndexedProperty(String propertyName) {
       return propertyName.indexOf(PropertyAccessor.PROPERTY_KEY_PREFIX_CHAR) != -1
           && propertyName.charAt(propertyName.length() - 1) == PropertyAccessor.PROPERTY_KEY_SUFFIX_CHAR;
   }
923347
public org.grails.datastore.mapping.query.api.ProjectionList min(String propertyName, String alias) {
        final AggregateProjection aggregateProjection = Projections.min(calculatePropertyName(propertyName));
        addProjectionToList(aggregateProjection, alias);
        return this;
    }