Announcement Announcement Module
No announcement yet.
Mapping for Spring-Hibernate DAO Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mapping for Spring-Hibernate DAO

    I have a question on the feasibility of a DAO pattern type of thing with Spring and Hibernate.

    I have the following hierarchy - a GenericHibernateDao which
    implements CRUD operations (using HibernateTemplate). I like to have
    specific instances inherit from this in the following manner. IUser is the interface
    which defines User specific methods. IUserHibernateDao
    will implements IUser and extends GenericHibernateDao. User is the entity that is mapped in the hbm.xml. For CRUD operations, I'm trying to save duplication by having IUserHibernateDao extend from GenericHibernateDao.

    My question is how do I map this in Spring applicationContext files? If I put IUserHibernateDao's details in the bean mapping, I get an error message that looks like it is expecting IUser. Any thoughts/suggestions will be appreciated.

  • #2
    I would suggest to check the docs and the Petclininc example which is in the spring distribution...
    For a generic DAO approach you can check here: