昨天面试被问了一个hibernate的问题,一个User类有username,password属性,还有otherInformation等其他属性,username和password映射到一个表,otherInformation等其他属性映射到另一个表,使用User类时不会感觉到是两个表的的存在,如何配置User.mapping.xml文件进行配置??
4条回答 默认 最新
kyo100900 2008-09-28 09:02关注这叫“Table per subclass”:
[code="xml"]
...
...[/code]
表2的主键与父表表1的主键是一个一对一的关联。
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报