querydslbindings不能将多个别名与路径结合
让我们首先看一下代码,以下是我将两个别名绑定到root的方式。同时创建的date,但只有一个总是生效的,最后一个别名终点将始终覆盖先前的启动,我希望既开始启动又有终点。为了同时有效,我该怎么办?
@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
}
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
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论