Hi_Amos
坚持每天都在进步!!
	public String deleteByUserAccount(String account) {
    方式一:	
Session session = this.getCurrentSession(); Criteria criteria = session.createCriteria(SysUserC.class).add(Restrictions.eq("account", account)); Object object = criteria.uniqueResult(); if (object == null) { return null; } else { session.delete((SysUserC)object); return "SUCCESS"; } }
   方式二:
     Session session = this.getCurrentSession();String sql = "delete from sys_sms_log where mobile='" + account + "'";

        session.createSQLQuery(sql).executeUpdate();

 

posted on 2013-10-24 15:56  Hi_Amos  阅读(2120)  评论(0编辑  收藏  举报