Re: Multiple Object Models

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Sep 30 2004 - 12:49:37 EDT

  • Next message: Andrus Adamchik: "Re: Flattened relationships example"

    Hi John,

    In terms of Cayenne, an object model would mean a DataMap XML file
    (unless you have something else in mind). Reusable Cayenne-enabled
    "framework" or "class library" is possible. It is simply a jar file
    with all DataObject classes and XYZ.map.xml. You can develop it as a
    separate project, using the Modeler and all, just make sure you don't
    include cayenne.xml in it when creating a final library jar (unless the
    applications that import it don't have other Cayenne stuff in them).

    "Importing" it in the application means adding a reference to the
    library's XYZ.map.xml in the app cayenne.xml. Unfortunately
    CayenneModeler currently doesn't support external DataMaps [this is on
    the feature list], so you'll have to do an extra deployment step -
    manually add an XYZ.map.xml reference to cayenne.xml. To make sure this
    doesn't interfere with your ability to edit application mapping in the
    modeler, you can keep custom cayenne.xml file separate from your
    project, and "inject" it in the app jar during deployment using cdeploy
    ant task - http://objectstyle.org/cayenne/userguide/deploy/cdeploy.html

    Andrus

    On Sep 30, 2004, at 10:40 AM, John Martyniak wrote:
    > I am new to Cayenne so please bear with me.
    >
    > Is their a way that you can load multiple object models?
    >
    > Basically what I am interested in doing is building a framework that
    > would
    > include the object model. Let's say for "user", which would have all
    > of the
    > tables and specific business logic for user management. This framework
    > could be used by multiple applications that maintain user information.
    >
    > Is their a way to do this in Cayenne? Or would the main Object Model
    > in the
    > Main Application have to import the User model into it?
    >
    > Thanks in advance.
    >
    > -John



    This archive was generated by hypermail 2.0.0 : Thu Sep 30 2004 - 12:49:41 EDT