• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

About dynamic query in chapter 7 of JPA Pro 2nd edition

 
Ranch Hand
Posts: 1748
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, the book shows a query:


The book says the query created will have a single quote prefix of empName like this:
SELECT e.salary  FROM Employee e WHERE e.department.name = 'NS65' AND e.name = ''Roberts' ;

Roberts becomes 'Roberts. And it won't find Robert's record.
However, after I tried a few times with this created query, it can find the Robert's record.

 
no wonder he is so sad, he hasn't seen this tiny ad:
professionally read, modify and write PDF files from Java
https://products.aspose.com/pdf/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!