Apply an "equal" constraint to the named property.


@param query
@param propertyPath property name prefixed with an association alias
@param argument     value
@param context
@return Predicate
175864
protected Predicate createEqual(Path root, CriteriaQuery<?> query, CriteriaBuilder cb, String propertyPath,
                                    Object argument, PersistenceContext context)
    {
        return cb.equal(root.get(propertyPath), argument);
    }
463967
@Override
	public synchronized List<T> filter(List<Predicate> predicates, Map<String, OrderType> orders, Set<String> properties, int firstResult, int maxResult) {
		
		// Criteria Builder
		CriteriaBuilder criteriaBuilder = getEntityManager().getCriteriaBuilder();
		
		// Requete de criteres
		CriteriaQuery<T>criteriaQuery = criteriaBuilder.createQuery(entityClass);
		
		// Construction de la racine
		Root<T> root = criteriaQuery.from(entityClass);
		
		// On positionne l'Alias
		root.alias(ROOT_ALIAS);
		
		// Selection de la racine
		criteriaQuery.select(root);
		
		// Ajout des Prédicats
		addPredicates(criteriaBuilder, root, criteriaQuery, predicates);
		
		// Ajout des Odres
		addOrders(criteriaBuilder, root, criteriaQuery, orders);
		
		// Ajout des Modes de chargements
		addProperties(root, criteriaQuery, properties);
		
		// Construction de la requete basée sur les critères
		TypedQuery<T> query = getEntityManager().createQuery(criteriaQuery);
		
		// Traitement de l'index du premier resultat
		
		// Si l'index du premier element est < 0
		if(firstResult < 0) query.setFirstResult(0);
		else query.setFirstResult(firstResult);
		
		// Traitement du nombre max de resultat
		
		// Si le nombre max d'element est <= 0
		if(maxResult > 0) query.setMaxResults(maxResult);
		
		// Execution
		List<T> results = query.getResultList();
		
		// On retourne le résultat
		return results;
	}
227380
@NonNull
    public Expression match(@NonNull String query) {
        if (query == null) {
            throw new IllegalArgumentException("query is null.");
        }
        return new FullTextMatchExpression(this.name, query);
    }
985250
public <K, V, E extends SimpleExpression<V>> MapPath<K, V, E> getMap(String property, Class<K> key, Class<V> value, Class<? super E> queryType) {
        validate(property, Map.class);
        return super.createMap(property, key, value, queryType);
    }
246202
private static Predicate<Triple> propertyFilter(final IRI model) {
        return of(model).filter(typeMap::containsKey).map(typeMap::get).orElse(basicConstraints);
    }
523834
public PropertyConstraint eq(String propertyName, Object propertyValue) {
        return new ParameterizedPropertyConstraint(propertyName, eq(propertyValue));
    }
1291736
public static Predicates<Object> equal(Object object)
    {
        if (object == null)
        {
            return Predicates.isNull();
        }
        return new EqualPredicate(object);
    }
70603
@SuppressWarnings({ "unchecked", "rawtypes" })
    public org.grails.datastore.mapping.query.api.Criteria eqAll(String propertyName, Closure<?> propertyValue) {
        return eqAll(propertyName, new grails.gorm.DetachedCriteria(targetClass).build(propertyValue));
    }
55180
protected function evaluatePropertyNameFilter(FlowQuery $query, $propertyNameFilter)
    {
        $resultObjects = [];
        $resultObjectHashes = [];
        foreach ($query->getContext() as $element) {
            $subProperty = ObjectAccess::getPropertyPath($element, $propertyNameFilter);
            if (is_object($subProperty) || is_array($subProperty)) {
                if (is_array($subProperty) || $subProperty instanceof \Traversable) {
                    foreach ($subProperty as $childElement) {
                        if (!isset($resultObjectHashes[spl_object_hash($childElement)])) {
                            $resultObjectHashes[spl_object_hash($childElement)] = true;
                            $resultObjects[] = $childElement;
                        }
                    }
                } elseif (!isset($resultObjectHashes[spl_object_hash($subProperty)])) {
                    $resultObjectHashes[spl_object_hash($subProperty)] = true;
                    $resultObjects[] = $subProperty;
                }
            }
        }

        $query->setContext($resultObjects);
    }
1085265
protected void configureVariableInstanceQuery(VariableInstanceQueryImpl query) {
    configureQuery(query);

    if(query.getAuthCheck().isAuthorizationCheckEnabled()) {

      CompositePermissionCheck permissionCheck;
      if (isEnsureSpecificVariablePermission()) {
        permissionCheck = new PermissionCheckBuilder()
            .disjunctive()
            .atomicCheck(PROCESS_DEFINITION, "PROCDEF.KEY_", READ_INSTANCE_VARIABLE)
            .atomicCheck(TASK, "RES.TASK_ID_", READ_VARIABLE)
            .build();
      } else {
        permissionCheck = new PermissionCheckBuilder()
              .disjunctive()
              .atomicCheck(PROCESS_INSTANCE, "RES.PROC_INST_ID_", READ)
              .atomicCheck(PROCESS_DEFINITION, "PROCDEF.KEY_", READ_INSTANCE)
              .atomicCheck(TASK, "RES.TASK_ID_", READ)
              .build();
      }
        addPermissionCheck(query.getAuthCheck(), permissionCheck);
    }
  }
1125926
@Nonnull
  public Query orderBy(@Nonnull FieldPath fieldPath, @Nonnull Direction direction) {
    Preconditions.checkState(
        options.startCursor == null && options.endCursor == null,
        "Cannot specify an orderBy() constraint after calling startAt(), "
            + "startAfter(), endBefore() or endAt().");

    QueryOptions newOptions = new QueryOptions(options);
    newOptions.fieldOrders.add(new FieldOrder(fieldPath, direction));

    return new Query(firestore, path, newOptions);
  }
677442
public static <T extends Comparable<?>> ComparablePath<T> comparablePath(Class<? extends T> type,
            Path<?> parent, String property) {
        return new ComparablePath<T>(type, PathMetadataFactory.forProperty(parent, property));
    }
134503
public <R> Predicate createPredicate(QueryCriteria criteria, CriteriaQuery<R> query, CriteriaBuilder builder) {
        // subquery and root
        Root<TaskImpl> taskRoot = getRoot(query, TaskImpl.class);
        Subquery<Long> subQuery = query.subquery(Long.class);
        Root<TaskVariableImpl> taskVarRoot = subQuery.from(TaskVariableImpl.class);
        subQuery.select(taskVarRoot.get(TaskVariableImpl_.taskId));

        // task variable predicate (in subquery)
        Predicate taskVariablePredicate = null;
        String listId = criteria.getListId();
        if( TASK_VARIABLE_COMBINED_ID.equals(listId) ) {
            List<QueryCriteria> taskVarSubCriteriaList = criteria.getCriteria();
            int size = taskVarSubCriteriaList.size();
            Predicate[] taskVarSubPredicates = new Predicate[size];
            for( int i = 0; i < size; ++i ) {
                taskVarSubPredicates[i] = createSingleTaskVariableCriteriaPredicate(
                        builder, taskVarRoot, taskVarSubCriteriaList.get(i));
            }
            taskVariablePredicate = builder.and(taskVarSubPredicates);
        } else {
            taskVariablePredicate = createSingleTaskVariableCriteriaPredicate(builder, taskVarRoot, criteria);
        }

        // add predicate to subquery
        subQuery.where(taskVariablePredicate);

        // create predicate for actual query that references subquery
        return taskRoot.get(TaskImpl_.id).in(subQuery);
    }
952266
public static <X, Y> PropertyPathExpression<X, Y> getExpression(
            Class<X> source, String propertyPath) {
        return getExpression(source, propertyPath, (Class<Y>) null);
    }
1122057
public <T> List<Predicate> byExample(ManagedType<T> mt, Path<T> mtPath, T mtValue, SearchParameters sp, CriteriaBuilder builder) {
        List<Predicate> predicates = newArrayList();
        for (SingularAttribute<? super T, ?> attr : mt.getSingularAttributes()) {
            if (!isPrimaryKey(mt, attr)) {
                continue;
            }

            Object attrValue = jpaUtil.getValue(mtValue, attr);
            if (attrValue != null) {
                predicates.add(builder.equal(mtPath.get(jpaUtil.attribute(mt, attr)), attrValue));
            }
        }
        return predicates;
    }
308476
public PropertyConstraint lt(String propertyName, Comparable propertyValue) {
        return new ParameterizedPropertyConstraint(propertyName, lt(propertyValue));
    }
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;
    }