• Post Reply Bookmark Topic Watch Topic
  • New Topic

code review: JPA criteria  RSS feed

Jeanne Boyarsky
author & internet detective
Posts: 37256
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was working on some JPA code here at CodeRanch. There's a lot of boilerplate code in using the Criteria API so I wanted to do something about that before creating a second use of it. Anything in here that is wrong/could be better? It does compile and run correctly. I just find it hard to believe this is the best way of using the API. And I couldn't find anything better to express the common code in the middle. I want to be able to call multiple Criterias from different methods in the same DAO so I was stuck with the anonymous inner class.

Superclass has:

And subclass has:
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!