DAO Inheritance

Discussions

EJB design: DAO Inheritance

  1. DAO Inheritance (2 messages)

    Does hibernate3 and ejb 3 managed object inheritance in the same manner.
    The way in which I am interested in doing it is using EJB3 and having subclasses of an object represented using a different table, instead of same table with all columns and nulled out values + class identifier.

    If i have such a table schema and switch to hibernate, does hibernate use the same options for polymorphism, that is different table for each concrete class. Will my database be portable which either implementation (ejb, hibernate) of my DAO layer.
    And for that matter I have not looked into JDO, but if anyone knows would such a schema be portable to a JDO implementation.

    Threaded Messages (2)

  2. JDO mapping[ Go to top ]

    AFAIK, JDO2.0 specify standard mapping attributes (in XML).
    So you should be able to map your objects to existing tables.

    See this JDO open source implementation:
    http://www.jpox.org
  3. Absolutely yes[ Go to top ]

    Hibernate is totally flexible as far as polymorphism is concerned. I think what you are asking about can be answered here

    The thing with Hibernate and it's mapping is that it does not assume that you started with Hibernate in mind. It is designed to work with legacy schemas, so the answer to your question is ABSOLUTELY YES!