I'm searching for a way to reuse common embeddable classes. For example, a generic Name class would contain all name parts (first, last, middle, prefix, suffix, nickname). However database tables in different projects would contain at least the first and last name, but may be missing other name fields.
It would be counterproductive to create a new Name class for every different database implementation and inheritance doesn't seem like a plausible solution. I also will not necessarily be able to modify the database tables.
I was hoping for some way via the AttributeOverride to say "just put a NULL here" such that the generated SQL would contain "NULL AS columnName" for the attributes that I choose to "ignore". That seems like the cleanest approach to me.
Has anyone tried to solve this problem or should I just get over it?
I am using Annotations 3.1.beta8 and EntityManager 3.1.beta6 with Hibernate 3.1.2 and an MS SQL Server db.
Thanks.
_________________ Bill Squires
|