Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA fetch with params

 
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