This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Spring and the fly likes Regarding Spring DAO Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "Regarding Spring DAO " Watch "Regarding Spring DAO " New topic
Author

Regarding Spring DAO

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,

I am trying to learn Spring . so please help me


According to the documentation

Spring Framework provides excellent DAO support including TransactionManagement and Exception Handling
With Spring Framework , DAO support is provided for JDBC, Hibernate, iBATIS, Java Data Objects (JDO),


Now i have a query .
For example if i am working with Hibernate then do i need to extend HibernateDAOSuppourt will then only My DAo class will be avialable to Spring Framework otherwise not .

Thanks in advance .






Save India From Corruption - Anna Hazare.
Eduardo Bueno
Ranch Hand

Joined: Jun 04, 2009
Posts: 155
I don't understand your question. HibernateDaoSupport is a class inside Spring ORM package; if you want to use both frameworks, that's the proper way.
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hey thanks for the response .

Just now i had seen a another example in which the DAOImplementaion class doesn't extend the HibernateDAOSuppourt class .







This class simply implements the DAO interface .

Please tell me i am getting confused .
Eduardo Bueno
Ranch Hand

Joined: Jun 04, 2009
Posts: 155
This may be also useful to you.
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

That was really nice link .Thanks once again .

It clearly shows why to go for Template Less and Template Supppourt of Spring Framework

But i still can't understand one thing here , Templates are providing a lot of benifits like Converting Exceptions (short for try/catch-finally-try/catch) the transaction management and resource management concerns are also addressed .

So keeping so much beneferies in Spring Template why the author itself prefers to go with Direct Hibernate rather than using Template Suppourt .


Thanks in advance .
Eduardo Bueno
Ranch Hand

Joined: Jun 04, 2009
Posts: 155
I can't answer that for you, but I have a theory: although Spring is a huge IoC manager, it is clinging more to the AOP development. That is where use the Session as a Spring proxy is more valuable than use it directly with hibernate.

Anyways, let's hope someone wiser can answer that for us.
 
 
subject: Regarding Spring DAO
 
Similar Threads
Why do we need a framework other than JDBC to access DB?
Unable to view list in drop down menu - JSTL
Building Effective Service layer using Spring+Hibernate
Persistence Framework
how to inject DAO with Spring???