`
springwork
  • 浏览: 3533 次
  • 性别: Icon_minigender_1
  • 来自: 西安
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表
保存或者更新对象时,防止出现同名的User对象 /** * 在更新时,验证用户名是否重复 */ public String saveOrUpdate(User user) { String hql = "from User where username=?"; //userid不为空,说明是更新操作 if(user.getUserid()!=null){ hql += " and userid!="+user.getUserid(); } List list = getHibernateTemplate().find ...
long start = System.currentTimeMillis(); ...... long end = System.currentTimeMillis(); System.out.println("运行时间:" + (end - start));
alter table 表名 add constraint 约束名 约束内容 =================== 主键约束 =================== alter table 表名 add constraint 约束名 primary key(主键字段) 如:alter table student add constraint PK_sid primary key(sid) =================== 默认约束 =================== alter table 表名 add constraint 约束名 default(默认值) for 字段名 ...
Global site tag (gtag.js) - Google Analytics