'QuerydslBindings cannot bind multiple aliases to a path
Let's look at the code first, the following is how I bind two aliases to root.createdDate at the same time, but only one will always take effect, and the last alias endDate will always override the previous beginDate,I want both beginDate and endDate to be valid at the same time, what should I do?
@Override
default void customize(QuerydslBindings bindings, QPointLog root) {
bindings.bind(root.member.username, root.memo).first((path, value) -> path.likeIgnoreCase("%" + EscapeCharacter.of('!').escape(value) + "%", '!'));
// The following is how I bind multiple aliases to a path
bindings.bind(root.createdDate).as("beginDate").first((path, value) -> new BooleanBuilder(path.goe(value)));
bindings.bind(root.createdDate).as("endDate").first((path, value) -> new BooleanBuilder(path.loe(value))); // invalid
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
