Package org.hibernate

Examples of org.hibernate.Session.save()


    if(bean.getTrackTime()==null)
      bean.setTrackTime(new Date());
    Session ssn = getSession();
    try{
      beginTransaction();
      ssn.save(bean);
      if(bean.getParentType()==_BeanBase.TYPE_DIARY){
        DiaryDAO.incTrackBackCount(ssn, bean.getParentId(), 1);
      }
      commit();
    }catch(HibernateException e){
View Full Code Here


   */
  public static void save(Object cbean){
    try{
      Session ssn = getSession();
      beginTransaction();
      ssn.save(cbean);
      commit();
    }catch(HibernateException e){
      rollback();
      throw e;
    }
View Full Code Here

      beginTransaction();
      if(mbean.getStatus()==MusicBean.STATUS_NORMAL){
        if(mbean.getMusicBox()!=null)
          mbean.getMusicBox().incMusicCount(1);
      }
      ssn.save(mbean);
      commit();
    }catch(HibernateException e){
      e.printStackTrace();
      rollback();
      throw e;
View Full Code Here

      order_value = friend.getSortOrder();
    }
    mbox.setSortOrder(order_value - (up ? 1 : 0));
    try {
      beginTransaction();
      ssn.save(mbox);
      // ���¶�ȡ�����б�����˳���������
      List links = findNamedAll("LIST_MUSICBOXES", mbox.getSite().getId());
      if (links.size() >= ConfigDAO.intValue(mbox.getSite().getId(),
          "MAX_MUSICBOX_COUNT", MAX_MUSICBOX_COUNT))
        throw new CapacityExceedException(links.size());
View Full Code Here

  public static void createSite(SiteBean site){
    site.setFunctionStatus(new FunctionStatus());
    Session ssn = getSession();
    try{
      beginTransaction();
      ssn.save(site);
      site.getOwner().setOwnSiteId(site.getId());
      ssn.update(site.getOwner());
      commit();     
    }catch(HibernateException e){
      rollback();
View Full Code Here

      order_value = friend.getSortOrder();
    }
    obj.setSortOrder(order_value - (up ? 1 : 0));
    try {
      beginTransaction();
      ssn.save(obj);
      List catalogs = findNamedAll("LIST_CATALOGS",obj.getSite().getId());
      if (catalogs.size() > 1) {
        for (int i = 0; i < catalogs.size(); i++) {         
          Orderable lb = (Orderable) catalogs.get(i);
          executeNamedUpdate("UPDATE_CATALOG_ORDER",(i+1),lb.getId());
View Full Code Here

    private void addProcessLog(long processInstanceId, String processId) {
        ProcessInstanceLog log = new ProcessInstanceLog(processInstanceId, processId);
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        session.save(log);
        session.getTransaction().commit();
    }
   
    private void updateProcessLog(long processInstanceId) {
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
View Full Code Here

   
    private void addNodeEnterLog(long processInstanceId, String processId, String nodeInstanceId, String nodeId, String nodeName) {
        NodeInstanceLog log = new NodeInstanceLog(NodeInstanceLog.TYPE_ENTER, processInstanceId, processId, nodeInstanceId, nodeId, nodeName);
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        session.save(log);
        session.getTransaction().commit();
    }
   
    private void addNodeExitLog(long processInstanceId, String processId, String nodeInstanceId, String nodeId, String nodeName) {
        NodeInstanceLog log = new NodeInstanceLog(NodeInstanceLog.TYPE_EXIT, processInstanceId, processId, nodeInstanceId, nodeId, nodeName);
View Full Code Here

   
    private void addNodeExitLog(long processInstanceId, String processId, String nodeInstanceId, String nodeId, String nodeName) {
        NodeInstanceLog log = new NodeInstanceLog(NodeInstanceLog.TYPE_EXIT, processInstanceId, processId, nodeInstanceId, nodeId, nodeName);
        Session session = HibernateUtil.getSessionFactory().getCurrentSession();
        session.beginTransaction();
        session.save(log);
        session.getTransaction().commit();
    }
   
    public void dispose() {
      HibernateUtil.getSessionFactory().getCurrentSession().close();
View Full Code Here

    }

    obj.setSortOrder(order_value - ((direction==1) ? 1 : 0));
    try {
      beginTransaction();
      ssn.save(obj);
      // ���¶�ȡ�����б�����˳���������
      List albums = findNamedAll("LIST_ALBUM",obj.getSite().getId());
      if (albums.size() >= ConfigDAO.getMaxAlbumCount(obj.getSite().getId()))
        throw new CapacityExceedException(albums.size());
      if (albums.size() > 1) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.