• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Himai Minh
Ranch Hand
Posts: 1400
  • 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.

Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!