roommanager.java

来自「jdo开发实例,一个功能全面的oa系统」· Java 代码 · 共 74 行

JAVA
74
字号
package com.gzrealmap.oa.room.business;

/**
 * <p>Title: RealOA</p>
 * <p>Description: RealOA</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: gzrealmap.com</p>
 * @author not attributable
 * @version 1.0
 */
import com.gzrealmap.oa.room.*;
import com.gzrealmap.oa.meeting.*;
import com.gzrealmap.oa.train.*;
import com.gzrealmap.lib.hibernate.HibernateUtil;
import java.io.*;

public class RoomManager {
  public RoomManager() {
  }
  public static void addRoom(RoomBean newRoom) throws Exception {
      HibernateUtil theHibernateUtil = HibernateUtil.getInstance();
      theHibernateUtil.create2Db(newRoom);
    }

    public static RoomBean findRoom(Integer obj) throws Exception {
      HibernateUtil theHibernateUtil = HibernateUtil.getInstance();
      return (RoomBean) theHibernateUtil.findByPrimaryKey(RoomBean.class,
          obj);
    }

    public static void updateRoom(RoomBean theUpdateRoom) throws
        Exception {
      HibernateUtil theHibernateUtil = HibernateUtil.getInstance();
      theHibernateUtil.update2Db(theUpdateRoom);
    }

    public static void removeRoom(RoomBean theRemoveRoom) throws
      Exception {
    HibernateUtil theHibernateUtil = HibernateUtil.getInstance();
    theHibernateUtil.remove4Db(theRemoveRoom);
  }
  /**
    * 增加一个Meeting
    */
  public static void addMeeting (MeetingBean newMeeting) throws Exception {
    HibernateUtil theHibernateUtil = HibernateUtil.getInstance();
    theHibernateUtil.create2Db(newMeeting);
  }
    public static void addMeeting2Room(RoomBean theOneInDataBase, MeetingBean theNewMany)
  throws Exception {
      theOneInDataBase.addMeeting(theNewMany);
      theNewMany.setRoomID(theOneInDataBase);
      addMeeting(theNewMany);
      updateRoom(theOneInDataBase);
     }

     /**
            * 增加一个TrainClass
            */

        public static void addTrainClass(TrainClassBean newTrainClass) throws Exception {
          HibernateUtil theHibernateUtil = HibernateUtil.getInstance();
          theHibernateUtil.create2Db(newTrainClass);
        }
        public static void addTrainClassr2TrainApp(RoomBean theOneInDataBase, TrainClassBean theNewMany)
       throws Exception {
          theOneInDataBase.addTrainClass(theNewMany);
          theNewMany.setRoomID(theOneInDataBase);
          addTrainClass(theNewMany);
          updateRoom(theOneInDataBase);
         }


}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?