Andrunevchyn

Andrunevchyn


August 2022
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  

Categories


Spring QueryDSL and Changing query runtime

Andriy AndrunevchynAndriy Andrunevchyn
 private class CustomReplaceVisitor extends ReplaceVisitor<Void> {
        @Override
        public Expression<?> visit(Path<?> path, Void context) {
            if (QItem.item.id.toString().equals(path.toString())) {
                return QItem.item.compatId;
            }
            return super.visit(path, context);
        }
    }

CustomReplaceVisitor replaceVisitor = new CustomReplaceVisitor();
            Predicate compatIdPredicate = (Predicate) predicate.accept(replaceVisitor, null);

andriy@andrunevchyn.com

Comments 0
There are currently no comments.