On 21/10/2013 10:18, Sergey Beryozkin wrote:
I believe the JPA2 way is to use either JPA2 Tuple or capturing beans/arrays which will filter the 'username' & 'enabled' properties at JPA/DB level, the JPA2 section has a couple of examples and JPATypedQueryVisitorTest has few more (to do with different styles of shaping the output), I'd probably go for using Tuple.

If you prefer to use a custom UserFilter then I guess you'd need to use
JPATypedQueryVisitor<User_JpaImpl> and then filter the result list with the filter afterwards

Thanks, I think I'm going to go with using another visitor just to do my validation, and then use the simple TypedQuery - any other approach seems to create more complexity (for my scenario) than it's worth.

Is there a reason why any errors in the parsing are silently swallowed in SearchContextImpl.getCondition():
        if (theExpression != null) {
            try {
                return parser.parse(theExpression);
            } catch (SearchParseException ex) {
                return null;
            }
        } else {
            return null;
        }

Thanks again.

Jim

Reply via email to