Return-Path: Delivered-To: apmail-incubator-cayenne-user-archive@locus.apache.org Received: (qmail 55138 invoked from network); 8 Apr 2006 03:47:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Apr 2006 03:47:55 -0000 Received: (qmail 91486 invoked by uid 500); 8 Apr 2006 03:47:55 -0000 Delivered-To: apmail-incubator-cayenne-user-archive@incubator.apache.org Received: (qmail 91238 invoked by uid 500); 8 Apr 2006 03:47:54 -0000 Mailing-List: contact cayenne-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cayenne-user@incubator.apache.org Delivered-To: mailing list cayenne-user@incubator.apache.org Received: (qmail 91229 invoked by uid 99); 8 Apr 2006 03:47:53 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Apr 2006 20:47:53 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [203.15.93.5] (HELO carme.synect.com) (203.15.93.5) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Apr 2006 20:47:52 -0700 Received: from localhost (localhost [127.0.0.1]) by carme.synect.com (Postfix) with ESMTP id 5A624367FD; Sat, 8 Apr 2006 13:17:30 +0930 (CST) Received: from carme.synect.com ([127.0.0.1]) by localhost (mail2.synect.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 26617-17; Sat, 8 Apr 2006 13:17:28 +0930 (CST) Received: from [203.15.93.218] (titan.internal.synect.com [203.15.93.218]) by carme.synect.com (Postfix) with ESMTP id C5C5436B8C; Sat, 8 Apr 2006 13:17:28 +0930 (CST) Message-ID: <44373251.6010604@synect.com> Date: Sat, 08 Apr 2006 13:17:29 +0930 From: Craig Turner User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051116) X-Accept-Language: en-us, en MIME-Version: 1.0 To: cayenne-user@incubator.apache.org CC: robert@synect.com Subject: Re: Seeking to automate generation the cayenne schema References: <44322D43.7090007@synect.com> <9ED4E94C-D911-4F47-9613-D594DA26455D@objectstyle.org> <8f985b960604040647v14974a8di72a5558a9259d254@mail.gmail.com> In-Reply-To: <8f985b960604040647v14974a8di72a5558a9259d254@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: amavisd-new at synect.com X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 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.