Re: Cayenne vs EOF functionality

From: Mike Kienenberger (mkienen..laska.net)
Date: Wed Apr 27 2005 - 09:52:17 EDT

  • Next message: Cris Daniluk: "Re: <cgen> Ant task and makepairs attribute"

    shaun <wojing..astmail.com.au> wrote:
    > Hi cayenne users,
    >
    > Is it possible to get all relationship and attribute names from a
    > DataObject or would I need to get this info from the DataMap?
    > In EOF i would use the following methods: toOneRelationshipKeys,
    > toManyRelationshipKeys, attributeKeys on an EO.

    It's best to get this information from the DataMap. However, you can easily
    add convenience methods to your DataObject class generation template to make
    it more transparent.

    For example, here's some code I use to get attributes (inside a DataObject
    class):

            EntityResolver entityResolver =
    getDataContext().getEntityResolver();
            ObjEntity objEntity = entityResolver.lookupObjEntity(getClass());
            Collection attributes = objEntity.getAttributes();



    This archive was generated by hypermail 2.0.0 : Wed Apr 27 2005 - 09:50:35 EDT