Hibernate
catstiger
这个作者很懒,什么都没留下…
展开
-
Spring下使用Hibenrate annotation
随着Hibernate3.2ga的推出,hibernate-annotation-3.2ga和hibernate-entitymanager也随之推出。EntityManager还没有用过,但是Annotation却彻底解决了hbm文件和domain类同步的问题。hibernate-annotation的中文文档也很详细,感谢翻译者的辛勤劳动。于是将正在进行的hibernate项目进行了升级,...2006-11-14 12:10:59 · 109 阅读 · 0 评论 -
Hibernate的一个bug,怎么还没有fix呀
opensource.atlassian.com/projects/hibernate/browse/HHH-2667;jsessionid=agpgVonKic_6nRkp6m如果没有显式的join一个集合,则不能引用这个集合中的属性。比如"from User u where u.roles.id=?"是不行的,而“select u from User u join u.roles r wh...2007-09-03 09:52:12 · 105 阅读 · 0 评论 -
Hibernate Dialect for SqlServer2005
Hibernate一直没有提供针对SqlServer2005的Dialect,原有的SqlServerDialect不支持物理分页查询。最近经常使用SqlServer2005,所以就很想写一个使用SqlServer2005 ROW_NUMBER()函数实现limit查询的Dialect类。下面这个类是使用ROW_NUMBER()函数分页的Dialect,开始是从NHibernate移植的,后来...2008-07-24 11:46:08 · 169 阅读 · 0 评论 -
Hibernate再次紧急求助
现在有两个Domain类,User和Dept,是ManyToOne关系,我查询某个Dept中所有的Users。Hibernate3.2.2之前,我可以这样写:from User u where u.dept.name=?,根据u.dept.name,Hibernate可以自动关联Dept。使用Hibernate3.2.5之后,出现“illegal attempt to dereferenc...2007-12-04 17:02:44 · 141 阅读 · 0 评论 -
Hibernate 隐含关联(implicit joins)的变化
前一个关于这个问题的帖子被隐藏了,这次说明确些。例如有两个类,员工TestEmployee 和部门TestDept,它们是ManyToOne关系:[code]@Entity@Table(name = "test_employees", uniqueConstraints = { })public class TestEmployee extends BaseModel impl...2007-12-05 10:03:22 · 138 阅读 · 0 评论