子类中的 Nhibernate / hibernate 鉴别器
我有一个带有鉴别器的子类,我可以在子类中再有另一个鉴别器吗
我会尽力解释
人表中的一个鉴别器可能是类型,我有两个子类学生和老师,在学生子类中,根据学生记录中的不同列,我有不同的学生子类。
现在我正在使用带有鉴别器的连接子类,但我无法在子类中进行区分
!------ Person
!-------------Student
!--------------------Student type A
!--------------------Student type B
!-------------Teacher
I have a subclass with a discriminator, can i have another discriminator in a subclass
I'll try to explain
One discriminator is in Person Table may be type and i have two subclasses Student and teacher, in a student subclass i have different subclasses of student based on a different column in student record.
Now i am using joined subclass with discriminator but i'm not be able to discriminate in a subclass
!------ Person
!-------------Student
!--------------------Student type A
!--------------------Student type B
!-------------Teacher
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如文档中所示:
“Hibernate 不支持混合
、
和
映射在同一个根
元素下”我认为这对你来说是一个麻烦,也许你可以打破加入的子类并使用 instaead ?BTW nh 增长得更快,有时比文档更快,但我认为这仍然适用于 NH 3.1.0
As in the documentation:
"Hibernate does not support mixing
<subclass>
, and<joined-subclass>
and<union-subclass>
mappings under the same root<class>
element" this I think is a troubkle for you, maybe you can break the joined subclass and use a instaead ?BTW nh is growing faster, sometimes faster than the doc, but I think this still apply to NH 3.1.0