06 2012 档案

Hibernate中使用COUNT DISTINCT
摘要:Hibernate中使用COUNT DISTINCT关键字: Hibernate在Hibernate中, 计算某列非重复记录的总数, 使用COUNT + DISTINCT在MySQL中,可以使用sql 代码 select COUNT(DISTINCT(name)) from products但在Hibernate中却不能用如下格式 select COUNT(DISTINCT(name)) from ProductDTO需要把里面的括号去掉, 改成 select COUNT(DISTINCT name ) from ProductDTO在MySQL中也可以使用这种样式. 阅读全文

posted @ 2012-06-28 13:24 timelyxyz 阅读(357) 评论(0) 推荐(0) 编辑

java.io.InvalidClassException解决
摘要:报错现象Oops: JPAQueryExceptionAn unexpected error occured caused by exception JPAQueryException: Error while executing query select t from TurnedIn t, Notification n where n.itemId=t.id and n.type=? and n.receiver.id=? and n.isDeleted=false group by t order by t.createTime desc: org.hibernate.type.Seri 阅读全文

posted @ 2012-06-26 09:51 timelyxyz 阅读(6124) 评论(0) 推荐(0) 编辑

pgSql, mySql中字符串转化为数字
摘要:pgSql 语法 to_number(text, text) 例子 select to_number(trim(both 'ibs' from classname), '999999') as cn from bbs order by cn /*trim(both 'ibs' from classname)去除classname字段中的'ibs'字符*/mySql语法 str*1 / str+1 / -str /*str为varchar的数字,此处不一定是1,只要是数字即可*/ hql 语法 to_number(text, tex 阅读全文

posted @ 2012-06-14 15:43 timelyxyz 阅读(2696) 评论(0) 推荐(0) 编辑

git查看commit的内容
摘要:在push之前有时候会不放心是不是忘记加某些文件,或者是不是多删了个什么东西,这时候希望能够看看上次commit都做了些什么。一开始想到的是用git diff,但是git diff用于当前修改尚未commit的时候较为方便,一旦commit后,需要指定上次节点的名称(一个hash值),不方便。这种时候用git log更合适,因为commit的内容会以log来记录。下面记录几个常用的情境以及对应的命令。仅仅想看最近谁有提交,以及提交的描述对应命令 git log显示Samplecommit 6305aa81a265f9316b606d3564521c43f0d6c9a3 Author: XXX. 阅读全文

posted @ 2012-06-13 12:24 timelyxyz 阅读(12897) 评论(0) 推荐(1) 编辑

Onunload与Onbeforeunload
摘要:Onunload,onbeforeunload都是在刷新或关闭时调用,可以在<script>脚本中通过window.onunload 来指定或者在<body>里指定。区别在于onbeforeunload在onunload之前执行,它还可以阻止onunload的执行。 Onbeforeunload也是在页面刷新或关闭时调用,Onbeforeunload是正要去服务器读取新的页面时调用,此时还没开始读取;而 onunload则已经从服务器上读到了需要加载的新的页面,在即将替换掉当前页面时调用。Onunload是无法阻止页面的更新和关闭的。而 Onbeforeunload 可 阅读全文

posted @ 2012-06-11 16:11 timelyxyz 阅读(224) 评论(0) 推荐(0) 编辑

关于firefox下js中动态组装select时指定option的selected属性的失效
摘要:问题描述:firefox下js中动态组装select时指定option的selected属性的失效有问题的代码如下:1 //加载select列表2varteaOption='',ownerSel=$("ownerSel");3for(vari=0;i<teaList.length;i++){4varteacher=teaList[i];5if(teacher.isDeleted===false){6vartid=teacher.id,tName=teacher.fullName,newOption;7varflag=((tid===formerOwne 阅读全文

posted @ 2012-06-07 08:34 timelyxyz 阅读(2022) 评论(0) 推荐(0) 编辑

org.hibernate.HibernateException: ordinal parameter mismatch
摘要:错误 org.hibernate.HibernateException: ordinal parameter mismatch 。我的错误是未将hql语句设置参数时的占位符去掉(粗糙流了下- -///)1hql+="andbbs.id=? "+bbs.id;在这之前网上发现的另一种错误也很值得注意:在数据表中用了关键字“call” 作为数据字段,所以产生了这个问题。Hibernate报错如下:org.hibernate.HibernateException:ordinalparametermismatchatorg.hibernate.engine.query.HQLQue 阅读全文

posted @ 2012-06-06 13:20 timelyxyz 阅读(2066) 评论(0) 推荐(0) 编辑

mooltools扩展之前已经定义好的方法和json数据
摘要:在原先的json数据中再新增数据Object.append(ajaxData,{arrAttach : xxx ... // 新的数据});扩展原先已经定义好的方法callFun.extend("bind",function(){...// 新的操作})这样可以用于多个并列操作,但又存在微小差异的ajax请求的发送varajaxData={"type":$sendObjDeal()},callFun=function(json){msgArea.appendHTML(json.html,"top");send.fireEvent(&q 阅读全文

posted @ 2012-06-04 14:22 timelyxyz 阅读(204) 评论(0) 推荐(0) 编辑

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

统计

点击右上角即可分享
微信分享提示