2014 年文章归档
共 6 篇文章
VO与PO之间相互转换
转换基类: public abstract class BaseConverter<V, P> { private static Logger logger = LoggerFactory.getLogger(BaseConverter.class); /** * 值对象与域对象之间属性复制 * * @param dto * 值对象 * @param domain * 域对象 * @param flag * 复制方向 */ protected void copyProperties(V dto, P domain, ConverterFlag flag) { switch (flag) { …
2014-11-13 13:55 · Web开发
删除重复记录的高效SQL
删除重复记录的高效SQL: delete from student pdi where pdi.rowid in (select t1.rowid FROM student t1, (select t.s_no, max(t.id) max_id from student t group by t.s_no having count(*) > 1) t2 where t1.s_no = t2.s_no and t1.id != t2.max_id)
2014-11-07 11:55 · Web开发
toString 方法
@Override public String toString() { StringBuilder buf = new StringBuilder(); Method[] methods = this.getClass().getMethods(); boolean isFirst = true; for (int i = 0, n = methods.length; i < n; i++) { try { Method method = methods[i]; if ((method.getModifiers() & Modifier.PUBLIC) == 1 && method.get…
2014-11-06 14:28 · Java基础
input 字母大小写转换
$("#textbox").bind('keyup', function (e) { if (e.which >= 97 && e.which <= 122) { var newKey = e.which - 32; // I have tried setting those e.keyCode = newKey; e.charCode = newKey; } $("#textbox").val(($("#textbox").val()).toUpperCase()); });
2014-03-06 12:55 · javascript