spring-projects / spring-projects/spring-data-commons

Support for dynamic path in QuerydslPredicateBuilder [DATACMNS-1093]

Open
#1,536 2 comments 0 reactions 1 assignee View on GitHub

@odrotbohm is already working on this.

Since Dec 30, 2020.

in: web type: enhancement
Dominant language
Java
Stars
838
Forks
730
PR merge metrics
No merged PRs in 30d

Description

Andrii Ivanenko opened DATACMNS-1093 and commented

In the case when property is declared as Object and for example Map is mostly used, it's not possible to filter against map keys.

private Object value;

When executing query with predicate

Expressions.stringPath("value.key1").eq("val1")

it returns correct results, but when trying to integrate with QuerydslPredicateBuilder there are problems.

In repository I've declared:

bindings.bind(Expressions.stringPath(QData.data.value, "key1")).as("k1").first((path, value) -> path.contains(value));

but exception is thrown in getTargetTypeDescriptor().

It would be great to have possibility at least to override method convertToPropertyPathSpecificType(), so developer can have control over converting values for custom paths


Affects: 1.13.4 (Ingalls SR4)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.