davidarnone (1) [Avatar] Offline
#1
We have a design which contains a common "info" object that is used at two different levels of aggregation. At one level the data it maps to is dynamic and is a view table (it is not possible to build a consistent physical table) and at another level of aggregation the object maps to a different physical table. Because a POJO can only be mapped to one DB table we have solved the problem by deriving two separate classes off of the "info" class. Both of these subclasses do not extend the base class in any way and are only derived so one can be mapped to the view and the other to the physical table. I consider this bad object design and we are only forced to do this because of Hibernate constrains.

My question is do we have the right solution? Is there a more elegant way of solving this problem?

Regards,
Dave Arnone