File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes code review: JPA criteria Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "code review: JPA criteria" Watch "code review: JPA criteria" New topic
Author

code review: JPA criteria

Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30380
    
150

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:


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
wood burning stoves
 
subject: code review: JPA criteria