posted 17 years ago
This may not be an ORM specific question but since I am asking in the context of "Java Persistance with Hibernate" I think this forum is as good as any...
In "JP w/H" the authors talk about compositions and they give an example of a USER table with colums for ADDRESS in the USER table. And then using a composition mapping to map the ADDRESS data to a seperate Address class that is a property of the User class. Address is a value type and User is an entity. (JP w/H p. 184,185).
While I understand the concept, other than legacy databases, I don't think I would ever impement the association as such. I would want a seperate table with it's own identity for Address and use a ManyToOne type of association. Am I naive to assume this is preferred?