Re: Seeking to automate generation the cayenne schema

From: Craig Turner (crai..ynect.com)
Date: Fri Apr 07 2006 - 23:47:29 EDT

  • Next message: Andrus Adamchik: "Re: Seeking to automate generation the cayenne schema"

    Andrus and Mike, thanks for your help with this. I've now got a simple
    implementation working. I've put a tar.gz of the work I've done up at
       http://203.15.93.19/GenerateModelTool.tar.gz
    (2.6MB, including scripts, pgsql driver and cayenne1.1M12 jar)

    It's far from mature:
    - Project isn't using ant yet, just a simple build script
    - I want to generate the XML using jdom rather than PrintWriter :)
    - I want to add command-line options to have the user set the package
    for the entities
    - I'd like to add support for Properties file configuration
    - I'd like to write a wrapper object so that it can be launched from
    java with simple configuration to a single class rather than from the
    command-line

    I wanted to get something working so that I could then ask the list
    where to go next and that's where it's at. Would there be interest to
    move this tool into the project, and if so would one of the developers
    indicate how to move forwards with this?

    If not then I'd like to set this up as a distinct tool administered out
    of my firm or sourceforge. Does anyone have strong feelings about things
    I could improve about this, or what the boundaries should be for a
    well-rounded tool of this type?

    Mike Kienenberger wrote:
    > On 4/4/06, Andrus Adamchik <andru..bjectstyle.org> wrote:
    >
    >>Everything in Cayenne can be assembled via API. So you'd go about
    >>assembling Cayenne stack in the following order:
    >>
    >>* create DefaultConfiguration
    >>* add DataDomain
    >>* add DataNode
    >>* add DataMap (using org.objectstyle.cayenne.access.DbLoader to
    >>create it from DB on the fly)
    >>
    >>Also since a generic DataObject class is supported, this will even
    >>work in Java:
    >>
    >>http://objectstyle.org/confluence/display/CAYDOC/Generic+Persistent
    >>+Class
    >
    >
    > Andrus, I think he's asking about how to create the xml config files.
    > So he'd need to do everything above, and then call some kind of xml
    > writer (probably a class in modeler.jar) to save it all back out as
    > xml. He'd probably also want to do the "sync to ObjEntity" stuff as
    > well to create the ObjEntities.
    >
    > Craig, I don't know how "straightforward" it would be, but the modeler
    > project should contain everything you need. You'd just call the java
    > "work" methods directly instead of going through the swing callbacks.



    This archive was generated by hypermail 2.0.0 : Fri Apr 07 2006 - 23:47:56 EDT