Cannot use identity column key generation with

/ 2014-03-16

在使用继承映射是 发生了一个错。。

开始以为是配置文件的文件。。

1.还报 撒sessionFactory的错。。

说  org.hibernate.mapping.UnionSubclass cannot be cast to org.hibernate.mapping.RootClass

这样一看感觉到了是继承映射写的有问题。。

就把相关的 类删除了。代码就能运行起了。。



org.hibernate.mapping.UnionSubclass cannot be cast to org.hibernate.mapping.RootClass

是因为2个继承的2张表内部还有 关系 如OneToMany。。



于是想到了 是不是子类的问题。

于是删除了之类的。。 结果还是没有运行起。


看来是父类的问题了。


看来半天也不晓得撒子出。。

于是就习惯行的搜了一下。


发现我使用的是默认的主键策略 。 而其他的使用的是 uuid 这样策略。

按照那样 结果就能运行起了。


难道是不支持 identity吗?

于是就出现了 Cannot use identity column key generation withmapping for:

不过使用 table也能支持。

但是table 总感觉不太合理

于是百度了下这个错 果然不支持呀。


不过看了下 支持 increment ,hilo。

转载请注明作者和出处,并添加本页链接。
原文链接: //xiaochun.zrlog.com/154.html