Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] QueryByExamplePolicy

Query by example is only designed for simple queries.  Once you want to start
applying functions you need to use a normal query (JPQL, Criteria,

You could potentially subclass your own QueryByExamplePolicy to build the
Expression you desire.

tbianchi wrote:
> I have a db field (varchar) that may or may not contain leading and
> trailing spaces.
> I would like to use query-by-example using this field as part of the
> object's example criteria but I need some way to tell the example to trim
> the field. A simple sql query would use: trim(name) = 'bob'
> Is there any way to configure the query by example to do this? Maybe using
> some flavor of QueryByExamplePolicy? 
> As always, thanks in advance.
> Tony

----- James Sutherland
 EclipseLink ,
Wiki: EclipseLink , TopLink 
Forums: TopLink , EclipseLink 
Book: Java Persistence 
Blog: Java Persistence
View this message in context:
Sent from the EclipseLink - Users mailing list archive at

Back to the top