摘要: 在Session的缓存中存放的是相互关联的对象图。默认情况下,当Hibernate从数据库中加载Customer对象时,会同时加载所有关联的 Order对象。以Customer和Order类为例,假定ORDERS表的CUSTOMER_ID外键允许为null以下Session的find()方法用于到数据库中检索所有的Customer对象:List customerLists=session.find("from Customer as c");运行以上find()方法时,Hibernate将先查询CUSTOMERS表中所有的记录,然后根据每条记录的ID,到ORDERS表中查询 阅读全文
posted @ 2013-01-22 13:45 疾行の亚索 阅读(195) 评论(0) 推荐(0) 编辑
摘要: From:http://www.javalobby.org/java/forums/t20533.htmlOne of the potential problems with object/relational mapping is that a lot of work has to be done to convert relational results into object results. Because of the nature of an object-level querying and criteria system, the results returned by a q 阅读全文
posted @ 2013-01-22 13:35 疾行の亚索 阅读(276) 评论(0) 推荐(0) 编辑