开发者

Hibernate many-to-many mapping

I am one of hibernate user in Australia. Recently, I have been dealing with hibernate many-to-many mapping and not going well though. I got in trou开发者_如何学Pythonble with "join/associate table with extra columns mapping".

Let`s say there are three tables called Product Order and OrderProduct (includes extra column quantity). Product holds many-to-many relationship with Order.

My confusion is that do we have to consider both ends of associate table when we are writing mapping files? or just write either side? Also, is it necessary to produce mapping file for the associate table as well?

Any suggestions will be appreciated!!


create a view to join two tables. this view and rest table is many to one relationship Hope it's userful


You should have an association mapping and entity because you need to create them just like an other entity.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜