This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes OpenJPA _ findByExample with Like and Case Insensitive Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "OpenJPA _ findByExample with Like and Case Insensitive " Watch "OpenJPA _ findByExample with Like and Case Insensitive " New topic
Author

OpenJPA _ findByExample with Like and Case Insensitive

Niall Loughnane
Ranch Hand

Joined: Dec 07, 2006
Posts: 201
Hi,

I am querying a database using OpenJPA and passing in an object as the SQL where,

I am using this code to create the query
[code=java]

CriteriaQuery<Employee> q = cb.createQuery(Employee.class);

Employee example = new Employee();
example.setSalary(10000);
example.setRating(1);

q.where(cb.qbe(q.from(Employee.class), example);
[/code]

But how can I to do a LIKE and a case Insensitive query on this query?

Thanks in Advance,

Niall
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: OpenJPA _ findByExample with Like and Case Insensitive
 
Similar Threads
Native Queries
About Named Queries
persistence.xml file for MS SQL Server 2000
J2EE - Entity & Entity Listeners usage
Web Services