Hibernate Reference: Chapter 7 (Association Mappings)
-----------------------------------------------------
Key: HHH-3262
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3262
Project: Hibernate3
Issue Type: Improvement
Components: documentation
Reporter: joel winteregg
If you just read section 7.2.3
http://www.hibernate.org/hib_docs/reference/en/html/associations.html#ass...
and the following sentence "We think it's better to use a join table for this
kind of association." users may think that one-to-many mapping should better use a
join table.
After chating with Steve it appears that example 7.2.3 was directly related to section
7.2.1. The above explanation ("We think it's better to use...") make sens if
you see 7.2.3 in contrast of 7.2.1 because the data model meaning of 7.2.1 is: Many person
could live at the same address. If you only look at 7.2.3 without thinking of 7.2.1 data
model, you could think that the data model only define: A person could have several
address. If so, the one-to-many mapping is okay (as explained in "Hibernate in
Action" chapter 7.2). But as I understood from my IRC chat, the data model here
(7.2.3) extend the data model of 7.2.1 so it is: An address could host several person and
a person could have several address which should be mapped as a many-to-many...
ERD would help a lot when reading these examples, or as said Steve: "probably those
two example should use the same tables, and then show mapping each side unidirectionally.
That would probably make the most sense"
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira