package cn.updev.Users.Static.UserOrGroupDAO;

import cn.updev.Database.HibernateSessionFactory;
import cn.updev.Users.User.GroupUser;
import cn.updev.Users.User.User;
import org.hibernate.Session;
import org.hibernate.Transaction;

/**
 * Created by blf2 on 15-11-24.
 */
public class UserOrGroupSave {

    public User saveUser(User user){
        Session session = HibernateSessionFactory.currentSession();
        Transaction transaction = session.beginTransaction();
        session.save(user);
        transaction.commit();
        HibernateSessionFactory.closeSession();
        return user;
    }

    public GroupUser saveGroupUser(GroupUser groupUser){
        Session session = HibernateSessionFactory.currentSession();
        Transaction transaction = session.beginTransaction();
        session.save(groupUser);
        transaction.commit();
        HibernateSessionFactory.closeSession();
        return groupUser;
    }
}

@@ -90,16 +90,65 @@
 actory;%0A
+import cn.updev.Users.Group.GroupInfo.GroupInfo;%0A
 import c
@@ -977,11 +977,342 @@
 r;%0A    %7D
+%0A%0A    public GroupInfo saveGroupInfo(GroupInfo groupInfo)%7B%0A        Session session = HibernateSessionFactory.currentSession();%0A        Transaction transaction = session.beginTransaction();%0A        session.save(groupInfo);%0A        transaction.commit();%0A        HibernateSessionFactory.closeSession();%0A        return groupInfo;%0A    %7D
 %0A%7D%0A

update DAO of UserOrGroupSave