Hi,
While writing hbm files -
Component is only available inside a class, not as a hight level entity by itslef.
<!ELEMENT hibernate-mapping (meta*, import*, (class|subclass|joined-subclass)*, query*)>
Hence a component even though same, needs to be defined over and over again for each class.
It would be nice to define it once and then just use it in a class that requires that component.
For e.g. Address. Address component can have line1, line2, city, state, zip. Now if I changed zip to zip_main and zip_extension, then I have to change it in every table where Address is included.
It would be nice to just change the component and then automatically have all your tables changed to use the new definition of that component.
Another goog example is "who" and "when" columns. They can be defined as a component just once and then reused where it's needed. And if you decide to change the way componet works for e.g. use user id insted of username, you just change it once in the component and all your classes get that functionality.
Think "Database patterns".
What do you think about adding this functionality?
Thanks,
Prashant Rane
|