Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

EJB-QL Locate

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys!
I'm quite confused on how EJB-QL function LOCATE works.
Correct me if I'm wrong but doesn't it works like String.indexOf()?
It returns the specified position where the search string is located in the searched string.
Does it return a negative value when the search string is not found?
I have an author field
this line
locate(bean.author, 'Lee') doesnt return a positive number
but my table contains records with fields having the value of "Stan Lee".
I'm quite confused really what should be the return value of this function.
Thanks.
 
reply
    Bookmark Topic Watch Topic
  • New Topic