Re: Vertical inheritance support proposal

From: Mike Kienenberger (mkienen..laska.net)
Date: Wed Jun 15 2005 - 16:54:35 EDT

  • Next message: Mike Kienenberger: "Re: Vertical inheritance support proposal"

    Andrus Adamchik <andru..bjectstyle.org> wrote:
    > So I guess we may say that doing it with composite objects is already
    > possible with Cayenne 1.1 and newer, and can be automated via class
    > generation. Downside - you need ObjEntities for "nonexistent" classes, but
    > otherwise it looks pretty clean (uniquing handling and all).

    Like Michael mentioned earlier, the biggest thing not handled is query
    paths. The end-user has to manually build the path through the entire
    inheritance chain. However, since I can probably store my queries in the
    modeler, this may not be all that much of an issue for me.

    There must be use cases that have "nonexistant" classes, but there's nothing
    abstract about the classes I'm currently working with.

    > I am not sure if we should add anything to Cayenne for that. Specifying
    > the composition "path" maybe? I'd rather make this a generic annotation
    > used by class generator (there is lots of unrelated requests to support
    > arbitrary annotations of the DataMap for customization ... this is a good
    > occasion to put it in).

    Yeah, I've been trying to figure out how to determine the path to the parent
    superEntity using isToMany and (isToMasterPK or isToDependentEntity) but I
    haven't gotten it to work yet. I might have discovered another bug as my
    expected inheritance objRelationship's getDbRelationships().size() is 0
    during cgen! All of the rest of the relationships are non-zero. Trying to
    track that down right now.

    If I can't determine it from the existing info (the relationship should meet
    the criteria of isToMasterPK and not toMany), then it'll somehow have to be
    indicated by the DataMap.

    I don't quite follow what you're suggesting by generic annotation. Maybe
    you could elaborate on that or point me to an existing thread/article.

    The second issue is that single-table inheritance is interfering with the
    ability to use composition. ${objEntity.Relationships} returns the
    objEntity's relationships + objEntity.getSuperEntity()'s relationships.

    Another bug -- it doesn't traverse the chain any farther --
    objEntity.getSuperEntity().getSuperEntity()'s relationships aren't included.

    > So Mike, do you think we'll get your project requirements addressed by the
    > quick composition solution (with class generator and model annotations),
    > and then do the right thing with flattened attributes, even if it takes
    > more time?

    I hope so. It's hard to know for sure yet at this point if the query
    issues are really going to affect me.



    This archive was generated by hypermail 2.0.0 : Wed Jun 15 2005 - 16:51:57 EDT