/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.toscana.dao.managers;

import com.toscana.util.ToscanaHibernateUtil;
import com.toscana.model.dao.implementations.UserDAOImplementation;
import com.toscana.model.dao.interfaces.UserDAO;
import com.toscana.model.sessions.User;
import java.util.ArrayList;

/**
 *
 * @author Arandi
 */
public class UserDAOManager {

    public UserDAOManager() {
        userDAO = new UserDAOImplementation();
    }

    public void add(User user) {
        try {
            ToscanaHibernateUtil.beginTransaction();
            userDAO.add(user);
            ToscanaHibernateUtil.commitTransaction();
        } catch (Exception e) {
            ToscanaHibernateUtil.rollbackTransaction();
        }
    }
    public ArrayList<User> findAll(){
        ArrayList<User> users = new ArrayList<>();
        try {
            ToscanaHibernateUtil.beginTransaction();
            users = (ArrayList<User>) userDAO.findAll(User.class);
            ToscanaHibernateUtil.commitTransaction();
        } catch (Exception e) {
        }
        
        return users;
    }
    private UserDAO userDAO;
}

@@ -789,24 +789,891 @@
     %7D%0A    %7D%0A
+    %0A    public void delete(User user)%7B%0A        try %7B%0A            ToscanaHibernateUtil.beginTransaction();%0A            userDAO.delete(user);%0A            ToscanaHibernateUtil.commitTransaction();%0A        %7D catch (Exception e) %7B%0A        %7D%0A    %7D%0A    %0A    public void update(User user)%7B%0A        try %7B%0A            ToscanaHibernateUtil.beginTransaction();%0A            userDAO.update(user);%0A            ToscanaHibernateUtil.commitTransaction();%0A        %7D catch (Exception e) %7B%0A            ToscanaHibernateUtil.rollbackTransaction();%0A        %7D%0A    %7D%0A    %0A    public User findByID(Integer ID)%7B%0A        User user=null;%0A        try %7B%0A            ToscanaHibernateUtil.beginTransaction();%0A            user =  userDAO.findByID(User.class, ID);%0A            ToscanaHibernateUtil.commitTransaction();%0A        %7D catch (Exception e) %7B%0A        %7D%0A        %0A        return user;%0A    %7D%0A    %0A
     public A

Update ClientManager