You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergey Beryozkin <sb...@gmail.com> on 2013/11/19 18:13:19 UTC

Re: Correct way to use a JPA*QueryVisitor with a filter class that is not a JPA entity

The exception is now propagated by default, in CXF 2.7.8 it will be 
possible to get it propagated by setting a 
"search.block.search.extension" to false

Sergey
On 21/10/13 21:07, Jim Talbut wrote:
> 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


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com