Announcement Announcement Module
Collapse
No announcement yet.
Method to obtain custom session in HibernateDaoSupport Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Method to obtain custom session in HibernateDaoSupport

    I've overloaded the Hiberate Session management to provide some custom features and wish to provide some of this custom Session management to HibernateDaoSupport. However, the getSession() methods are final. Is there anyway that I can extend HibernateDaoSupport to provide a custom getSession implementation?

    Mike

  • #2
    As you can see from the sources all the methods are market final except initDAO which is the hook offered for subclasses. getSession() uses SessionFactoryUtils for retrieving the sessions so you can:

    1. either copy-paste HibernateSupportDAO to use your classes (ugly version)
    2. extend SessionFactoryUtils and/or HibernateTemplate and add your extra functionality and then use initDAO for any extra initialization if you need.
    Thus the calls delegated by DAOSupport to these classes will return what you need.

    Comment


    • #3
      Thanks for your help.

      Comment

      Working...
      X