Build a generic typesafe DAO with Hibernate and Spring AOP

On IBM developerworks I found an interesting article about how to create a type safe data acess object implementation which is generic too.

With the adoption of Java™ 5 generics, the idea of a generic typesafe Data Access Object (DAO) implementation has become feasible. In this article, system architect Per Mellqvist presents a generic DAO implementation class based on Hibernate. He then shows you how to use Spring AOP introductions to add a typesafe interface to the class for query execution.


Tags: , , ,

2 Responses to “Build a generic typesafe DAO with Hibernate and Spring AOP”

  1. proxxi Says:

    As I’m not completely sure if this post has an information value for me, let me point it like this: When I “implent” it, will it get my hair grow again?


  2. vojtech.szocs Says:

    Hi, we have released an OpenSource project that goes far beyond a generic CRUD-like DAO.

    It’s called DAO Fusion (seems like I can’t post links here).

    DAO Fusion is a lightweight yet comprehensive tool for building reliable, maintainable and testable DAO layers using JPA / Hibernate.

    It covers five main areas related to DAO layer development:

    – persistent entity model
    – standard persistent entity DAO interfaces / abstract implementations
    – persistent entity criteria API with advanced filtering, sorting and paging capabilities
    – criteria transfer object (CTO) pattern that allows clients to specify entity criteria easily (this is especially useful for grid-like operations)
    – integration test support using JUnit / Spring TestContext framework (core DAO functionality is integration-tested out-of-the-box for many popular databases)

    The project is open to everyone interested in JPA, Hibernate and related technologies.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: