• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

code review: JPA criteria

author & internet detective
Posts: 40169
Eclipse IDE VI Editor Java
  • 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:
My, my, aren't you a big fella. Here, have a tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic