`
blues1021
  • 浏览: 136038 次
  • 性别: Icon_minigender_1
  • 来自: 南宁
社区版块
存档分类
最新评论

Unity3DHouse中成功删除信息

    博客分类:
  • SSH
 
阅读更多

//在jsp页面传入的参数在Action类中调用deleteHouse方法,此方法由HouseDao类中声明。

public boolean deleteHouse(Integer id){
    /* Long i = new Long(id);
       Long id1=(Long)id;
       Integer i=new Integer(id);
        Housinginfo house;
         tx=session.beginTransaction();
          TbLiuyan   liuyan=(TbLiuyan)session.get(TbLiuyan.class,id);
          session.delete(liuyan);
          */
        
Query q = getSession().createQuery("delete Housinginfo WHERE houseId=?");
         q.setInteger(0, id);
         q.executeUpdate();
         return true;

        
        
        /*Session session = sessionFactory.openSession();    
        Transaction tx = session.beginTransaction();    
        String hqlDelete = "delete Customer where name = :ldName";    
        int deletedEntities = s.createQuery( hqlDelete )    
        .setString( "oldName", oldName )    
        .executeUpdate();    
        tx.commit();    
        session.close();
        
        try{
            house = (Housinginfo)this.getHibernateTemplate().load(Housinginfo.class,i);
            this.getHibernateTemplate().delete(house);
        }catch(Exception e){
            System.out.println("dao内删除房子信息异常!");
            return false;
        }
        return true;
        */
      }

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics