随笔分类 - Hibernate
新手
Hibernate和Spring的延迟加载和DAO模式
摘要:转载于:http://spaces.msn.com/members/zcgly/Blog/cns!1pQwDnSfBx4siamZpHR2gqMQ!121.entryHibernate和Spring的延迟加载和DAO模式原文:http://www.jroller.com/page/kbaum/20040708作者:Karl Baum译者:zcgly时间:2005-07-13Hibernate和延迟...
阅读全文
用spring管理hibernate事务时,lzay="true"不能用的解决方法
摘要:在web.xml下面加上<filter><filter-name>hibernateFilter</filter-name><filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class></filter&g...
阅读全文
usertype的详细解释和使用实例
摘要:import java.sql.PreparedStatement;import java.sql.ResultSet;import java.sql.SQLException;import net.sf.hibernate.HibernateException;/*** @author hy-he**/public interface UserType {/** * 返回UserType所映射字...
阅读全文
Incorrect result size: expected 1, actual 0错误以及解决方法
摘要:错误如下:org.springframework.dao.IncorrectResultSizeDataAccessException: Incorrect result size: expected 1, actual 0spring的javadoc上讲getObject(String, Object[], Class) will return NULL if the result of the...
阅读全文
Hibernate中get查询和load查询的异同(深入浅出hibernate)
摘要:1.如果没有符合条件的纪录,get返回一个null,load会抛出一个ObjectNotFountdException2.load返回实体的代理类实例,get方法永远直接返回实体类。3.load方法充分利用内部缓存和二级缓存,get方法只使用内部缓存,没有就直接查询!!!所以,如果要利用二级缓存的时候,要用load读取数据。
阅读全文