上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 85 下一页
摘要: 3. 参数绑定: Hibernate中对动态查询参数绑定提供了丰富的支持,那么什么是查询参数动态绑定呢?其实如果我们熟悉传统JDBC编程的话,我们就不难理解查询参数动态绑定,如下代码传统JDBC的参数绑定: PrepareStatement pre=connection.prepare(“select * from User where user.name=?”); pre.setString(1,”zhaoxin”); ResultSet rs=pre.executeQuery(); 在Hibernate中也提供了类似这种的查询参数绑定功能,而且在Hibernate中对这个功能还提... 阅读全文
posted @ 2012-05-05 17:45 hibernate3例子 阅读(4652) 评论(0) 推荐(0) 编辑
摘要: Criteria[1]是一种比hql更面向对象的查询方式。Criteria 可使用 Criterion 和 Projection 设置查询条件。可以设置 FetchMode( 联合查询抓取的模式 ) ,设置排序方式,Criteria 还可以设置 FlushModel (冲刷 Session 的方式)和 LockMode (数据库锁模式)。 Criterion 是 Criteria 的查询条件。Criteria 提供了 add(Criterion criterion) 方法来添加查询条件。 Criterion 接口的主要实现包括: Example 、 Junction 和 SimpleEx... 阅读全文
posted @ 2012-05-05 11:15 hibernate3例子 阅读(185) 评论(0) 推荐(0) 编辑
摘要: *HQL1.查询多个对象select art, user from Article art, User user where art.author.id = user.id and art.id =: id这种方式返回的是Object[], Object[0]:article, Object[1]:user.2.分页query.setFirstResult, query.setMaxResults.查询记录总数query.iterate("select count(*) from Person").next()3.批量更新query.executeUpdate()可能造成二 阅读全文
posted @ 2012-05-05 11:13 hibernate3例子 阅读(216) 评论(0) 推荐(0) 编辑
摘要: extjs3.3.1版本JsonStore代码var sexStore_para = new Ext.data.JsonStore({//对应类别store url:'/himp/related_user_info!getTheDataProvidedToComboboxAjax.action',//'/financeStaff.do?method=dictData', // root:'model', ... 阅读全文
posted @ 2012-05-05 10:21 hibernate3例子 阅读(507) 评论(0) 推荐(0) 编辑
摘要: public static <T> List<T> copy(List<T> source) throws IllegalAccessException, InvocationTargetException, InstantiationException, NoSuchMethodException { //clone后的集合 List<T> temp=new ArrayList<T>(); for(T t:source){ //T temporary=(T) source.getClass().newInstan... 阅读全文
posted @ 2012-05-05 09:58 hibernate3例子 阅读(223) 评论(0) 推荐(0) 编辑
摘要: java.lang .ClassInstances of the class Class represent classes and interfaces in a running Java application. An enum is a kind of class and an annotation(注释) is a kind of interface. Every array also belongs(属于) to a class that is reflected as aClass object that is shared(共享) by all arrays with the s 阅读全文
posted @ 2012-05-04 19:06 hibernate3例子 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 关键字: js一、类型转换 1.转换成字串 ECMAScript的Boolean值、数字和字串的原始值的有趣之处在于它们是伪对象,这意味着它们实际上具有属性和方法。 如: Js代码varsColor="blue"; alert(sColor.length);//outputs"4"[js] view plaincopyvarsColor="blue";alert(sColor.length);//outputs"4"总而言之,3种主要的原始值Boolean值、数字和字串都有toString()方法。ECMAScri 阅读全文
posted @ 2012-05-04 13:35 hibernate3例子 阅读(160) 评论(0) 推荐(0) 编辑
摘要: Convention Plugin原文:http://cwiki.apache.org/WW/convention-plugin.html翻译:石太祥(ealpha@gmail.comhttp://www.lalfa.com)·1Introduction·2Setup·3Converting a Codebehind based application to Convention·4Hello world·5Code behind hello world·6Results and result codes·7Chaining 阅读全文
posted @ 2012-05-04 12:58 hibernate3例子 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 3秒搞定!~~ 一亿数据获取前100个最大值整合网络上的算法。 根据我的思路。计算一亿个数字中最大的前100个值。昨晚效率还是很低。 今天搞的算法。 只需要3秒钟。 获取前100个 前1000个 速度都非常快。算法原理:把一亿个数字的前100个 首先放入数组。 然后把最小值放在ary[0]。然后再,循环100到一亿 之间的。 每次循环判断当前数字是否大于ary[0]当大于时,当前数字放入ary[0] 并再次重构数组最小值进入ary[0] 以此类推 。当循环完这一亿个数字后。 最大的前100个数字就出来了。源码分享地址:http://download.csdn.net/download/yjfl 阅读全文
posted @ 2012-05-04 10:39 hibernate3例子 阅读(474) 评论(0) 推荐(0) 编辑
摘要: ### 指定加载struts2配置文件管理器,默认为org.apache.struts2.config.DefaultConfiguration### 开发者可以自定义配置文件管理器,该类要实现Configuration接口,可以自动加载struts2配置文件。# struts.configuration=org.apache.struts2.config.DefaultConfiguration### 设置默认的locale和字符编码# struts.locale=en_USstruts.i18n.encoding=UTF-8### 指定struts的工厂类# struts.objectFa 阅读全文
posted @ 2012-05-03 19:42 hibernate3例子 阅读(113) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 85 下一页