@@ -0,0 +1,2119 @@
+package org.thuta.dao;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0Aimport org.hibernate.Query;%0Aimport org.springframework.stereotype.Repository;%0Aimport org.springframework.transaction.annotation.Propagation;%0Aimport org.springframework.transaction.annotation.Transactional;%0Aimport org.thuta.dao.interfaces.IUserDAO;%0Aimport org.thuta.entities.Profile;%0Aimport org.thuta.entities.User;%0Aimport org.thuta.entities.interfaces.IProfile;%0Aimport org.thuta.entities.interfaces.IUser;%0A%0A@Repository(%22UserDAO%22)%0A@Transactional(propagation=Propagation.SUPPORTS)%0Apublic class UserDAO extends RootDAO implements IUserDAO %7B%0A%09private static int noOfRows;%0A%0A%09@Transactional(propagation=Propagation.REQUIRED)%0A%09public void addUser(IUser user) %7B%0A%09%09currentSession().save(user);%0A%09%7D%0A%09%0A%09@Transactional(propagation=Propagation.REQUIRED)%0A%09public void updateUser(IUser user) %7B%0A%09%09currentSession().update(user);%0A//%09%09currentSession().flush();%0A//%09%09currentSession().close();%0A%09%7D%0A%09%0A%09@Transactional(propagation=Propagation.REQUIRED)%0A%09public void removeUser(IUser user) %7B%0A%09%09if(user != null) %7B%0A%09%09%09IUser userTemp = (IUser) currentSession().get(User.class, user.getId());%0A%09%09%09currentSession().delete(userTemp);%0A%09%09%7D%0A%09%7D%0A%09%0A%09@Transactional(propagation=Propagation.REQUIRED)%0A%09public IUser findUser(long id) %7B%0A%09%09return (IUser) currentSession().get(User.class, id);%0A%09%7D%0A%09%0A%09@Transactional(propagation=Propagation.REQUIRED)%0A%09public List%3CIUser%3E findAllUser() %7B%0A%09%09List%3CIUser%3E result = new ArrayList%3CIUser%3E();%0A%09%09Query q = currentSession().createQuery(%22from org.thuta.entities.User%22);%0A%09%09noOfRows = q.list().size();%0A%09%09result = q.list();%0A%09%09return result;%0A%09%7D%0A%09%0A%09@Transactional(propagation=Propagation.REQUIRED)%0A%09public List%3CIUser%3E findUserByUsernamePassword(String username, String password) %7B%0A%09%09List%3CIUser%3E result = new ArrayList%3CIUser%3E();%0A%09%09Query q = currentSession().createQuery(%22from org.thuta.entities.User where username = :username and password = :password%22);%0A%09%09q.setParameter(%22username%22, username);%0A%09%09q.setParameter(%22password%22, password);%0A%09%09noOfRows = q.list().size();%0A%09%09result = q.list();%0A%09%09return result;%0A%09%7D%0A%09%0A%09public int getNoOfRows() %7B%0A%09%09return noOfRows;%0A%09%7D%0A%7D%0A

Create UserDAO.java