Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JPA fetch with params  RSS feed

 
surlac surlacovich
Ranch Hand
Posts: 296
Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Folks!
I need to create generic method to fetch from DB with JPA. It means it can receive parameters which will narrow the results down. The implementation that I have:

I'm just wondering, how to replace this boilerplate code? Is there any way where I can just write like this:

Usage:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!