I had thought of <component>'s slightly differently - expecting them to be reuseable within different classes. Because I am generating base java classes and the DDL from the hbm file, mapping of component columns into two tables is of no concern to me (it is done auto-magically by the tools). All I wanted to end up with is a single java class representing a telephone number (providing business logic for rating etc.), no matter how many entities used it. Currently (and it is a very small issue to me), I need to cut and paste the same component definition into every containing class.
I do recognise the issues of mapping different columns etc., in existing databases. I had not considered this before.
- Steven.
|