0 Replies Latest reply on Aug 17, 2010 8:49 AM by samer_sadek

    ORM Question: Abstract Class

    samer_sadek

      This is a simplification to a conceptual level, but if anybody would like, I can specify a lot more details.
      In a nut shell, I have ObjectA that contains ObjectB. ObjectB is nothing more than a shell, containing 4 Objects: ObjectC, ObjectD, ObjectE and ObjectF.
      ObjectB is an abstract class, but all the others are concrete, each with a corresponding table.
      If I tell Hibernate that ObjectB is non persistent, it will ignore it and will not create any of it's children, which are persistent. But I cannot tell it that it is persistent either, because I cannot point to a table and a column with the link.
      Here is some more info:
      • We cannot make any design changes to the objects, because these are reused in multiple applications.
      • We considered using the embedded attribute, but that would only work if ObjectB was persistent, while the others were not. Our case is the opposite.

       

      So my question is how to handle a non persistent object that contains persistent objects

       

      Thanks