|
Hello,
I'm just starting with hibernate, my only ORM experience was with Rails' ActiveRecord. While I'm enjoying the experience so far, I have a very specific doubt that I couldn't find the answer to, anywhere.
The use case is the following: We have three entitities classes, A, B and C. C, when created, may be of A or B type depending on user input. In other words, the C inheritance hierachy may change at runtime but only in the creation (new record) process.
Another more solid example: The C class would be the "Client" class. However, "Client" may be a "Company" or "Person", depending on what the user chooses in a combo box when creating this object.
Is it bad modelling? Someone told me that a simple attribute on the client class would suffice, however, I don't feel that this way I would be leveraging OOP.
Thanks,
Marcelo.
|