Use bernate Session Factory instead of bernate Template as.
Use bernate Session Factory instead of bernate Template as: public abstract class HomeSessionFactory { @Autowired protected SessionFactory sessionFactory; } extend this class in your xxDAOImpl file as. @Repository("LoginDetailsDAO") @Transactional public class LoginDetailsDAOImpl extends HomeSessionFactory implements LoginDetailsDAO { @SuppressWarnings("unchecked") @Transactional(readOnly = true) public List loginDetails(UserLogin login) { Session session = sessionFactory.openSession(); Transaction transaction = session. BeginTransaction(); List result = session.
CreateQuery("from UserLogin").list(); transaction.commit(); return result; } } Spring Context file: org.hibernate.dialect. MySQLDialect true com.home.app.model. UserLogin properties/database.properties.
In previous versions of Spring, the template model was used to provide a common abstraction for many different frameworks ( JPA, JMS etc. ). While this made developing easy, it also tied your business code to the Spring Framework. One of the goals of Spring 3.
X is to decouple your application code from Spring, requiring you to use as little Spring-specific code as possible, thus making your code more reusable. The recommended integration style is to code DAOs against plain JPA, and JDO APIs. The older style of using Spring's DAO templates is no longer recommended; however, coverage of this style can be found in the Section A.1, “Classic ORM usage†in the appendices.
Source The enhanced functionality provided by Spring (Transaction management, exception translation etc. ) now happens through AOP, and you don't have to worry about it in your code. The mechanism is described in: 13.3.2. Implementing DAOs based on plain bernate 3 API whereas the legacy approach is covered in Classic ORM Usage: A.1.1.1 The bernateTemplate.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.