Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » query-by-example and trim?(how to trim for example query?)
query-by-example and trim? [message #641025] Tue, 23 November 2010 23:18 Go to next message
tbianchi  is currently offline tbianchi
Messages: 4
Registered: November 2010
Junior Member
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
Re: query-by-example and trim? [message #641471 is a reply to message #641025] Thu, 25 November 2010 15:32 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Query by example is for simple queries. You will need to use JPQL, Criteria, or Expressions.


James : Wiki : Book : Blog : Twitter
Previous Topic:MySQL: update on self-referencing foreign key tables leads to Duplicate Key Exception
Next Topic:reading new primary key of inserted object
Goto Forum:
  


Current Time: Sat Oct 25 00:42:51 GMT 2014

Powered by FUDForum. Page generated in 0.01546 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software