Skip to main content

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 Friend
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.
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 SutherlandFriend
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 Dec 05 09:08:11 GMT 2020

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

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

Back to the top