Re: Cayenne POJO inheritance

From: Gilberto C. Andrade (gilbertoc..mail.com)
Date: Mon Aug 10 2009 - 13:49:18 EDT

  • Next message: Lawrence Gerstley: "Oracle CONTAINS clause?"

    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 : Mon Aug 10 2009 - 13:49:55 EDT