Re: transient relations

From: Mike Kienenberger (mkienen..laska.net)
Date: Sat Oct 30 2004 - 14:24:02 EDT

  • Next message: Jürgen Saar: "Re: transient relations"

    =?iso-8859-1?Q? J=FCrgen=20Saar ?= <jsaa..eb.de> wrote:
    > > Why not just add a method to the Order class that does something like
    the
    > > following?
    > >
    > > public List getUrlList()
    > > {
    > > return listOfUrlsCreatedFromArchiveForOrder(this);
    > > }
    > >
    > > The purpose of Cayenne is to make a database-backed object look like a
    > > regular java object. It seems that you are trying to do the opposite --

    > > make a regular java object look like a database-backed object.
    > >
    > > What are you hoping to accomplish? Is there a reason why you want URLs
    to
    > > look like a database-backed object that you have not stated? It's
    unclear
    > > why you want to create a DBEntity or ObjEntity for URLs.
    > > Why not leave it as a non-database object?
    >
    > I'm building some generic classes for reporting and webinterfaces.
    > For those classes the attributes/relations are all they can see
    > and because of this, all data have to be transported this way.
    >
    > BTW: my methods looks like yours, addionally urlList is a relation in the
    repository.

    I guess I just don't understand.

    If it works for you, I guess that's good enough.

    But you shouldn't be creating DBEntity and ObjEntity classes for
    non-database objects.
    It's just going to cause you problems later on.

    What would break if you didn't define DbEntity and ObjEntity classes?

    -Mike



    This archive was generated by hypermail 2.0.0 : Sat Oct 30 2004 - 14:22:46 EDT