Re: Cayenne POJO inheritance

From: Gilberto C. Andrade (gilbertoc..mail.com)
Date: Fri Aug 14 2009 - 15:41:03 EDT

  • Next message: Aristedes Maniatis: "Re: Cayenne POJO inheritance"

    Ok, after a good read on [1] and [2], I could understand that what I
    want to do [3], right now, is not implemented in cayenne. Cayenne
    only supply table-per-class-hierarchy feature.
    Is that right?

    Gilberto

    [1] http://cayenne.apache.org/doc/inheritance-overview.html
    [2] http://cayenne.apache.org/doc/modeling-inheritance.html
    [3] http://edocs.bea.com/kodo/docs324/img/inheritance-vertical.png

    On Mon, Aug 10, 2009 at 2:49 PM, Gilberto C.
    Andrade<gilbertoc..mail.com> wrote:
    > Thanks Tore, but my initial problem is understand Andrus's tips:
    > 3 Run class generator to generate the _Xyz superclasses.
    > 4 Change the existing classes by hand to inherit from _Xyz counterpart.
    > 5 Remove existing persistence fields, and use superclass getters and
    > setters to access them. * Change the API throughout the code to use
    > Cayenne ObjectContext and Queries.
    >
    > In my model I have this hierarchy (implemented):
    >
    > Pessoa->PessoaFisica
    > Pessoa->PessoaJuridica
    >
    > Cayenne Modeler generated:
    >
    > public abstract class Pessoa extends _Pessoa
    > public class PessoaFisica extends _PessoaFisica
    > public class PessoaJuridica extends _PessoaJuridica
    >
    > and this one into auto package:
    >
    > public abstract class _Pessoa extends CayenneDataObject
    > public abstract class _PessoaFisica extends Pessoa    <========== HERE
    > IS THE POINT
    > public abstract class _PessoaJuridica extends Pessoa <========== HERE
    > IS THE POINT
    >
    > Is that all ok? Shouldn't [_PessoaFisica extends Pessoa] be
    > [_PessoaFisica extends _Pessoa ]?
    >
    > Gilberto
    >



    This archive was generated by hypermail 2.0.0 : Fri Aug 14 2009 - 15:41:43 EDT