Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Case Insensitive Hibernate Queries

 
Bai Shen
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a query that pulls a username from a database. It works, except it requires and exact match, and I want it to be case insensitive. How do I do this?

 
Dave Mark
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Be aware that those are DB specific SQL functions. Those aren't part of ANSI SQL, so not every DB would use/support it.

Better use Example#ignoreCase().
 
Bai Shen
Ranch Hand
Posts: 323
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bauke Scholtz wrote:Be aware that those are DB specific SQL functions. Those aren't part of ANSI SQL, so not every DB would use/support it.

Better use Example#ignoreCase().


What do you mean by Example#ignoreCase()?
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bauke is refering to Criteria queries rather than HQL. See the JavaDocs.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic