Return-Path: Delivered-To: apmail-incubator-cayenne-user-archive@locus.apache.org Received: (qmail 16662 invoked from network); 8 Apr 2006 11:13:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Apr 2006 11:13:31 -0000 Received: (qmail 46401 invoked by uid 500); 8 Apr 2006 11:13:31 -0000 Delivered-To: apmail-incubator-cayenne-user-archive@incubator.apache.org Received: (qmail 46149 invoked by uid 500); 8 Apr 2006 11:13:30 -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 46139 invoked by uid 99); 8 Apr 2006 11:13:30 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 08 Apr 2006 04:13:30 -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 [64.124.179.114] (HELO mensk.objectstyle.org) (64.124.179.114) by apache.org (qpsmtpd/0.29) with SMTP; Sat, 08 Apr 2006 04:13:27 -0700 Received: (qmail 23921 invoked from network); 8 Apr 2006 11:13:06 -0000 Received: from localhost (HELO ?IPv6:::1?) (127.0.0.1) by mensk.objectstyle.org with SMTP; 8 Apr 2006 11:13:06 -0000 In-Reply-To: <44373251.6010604@synect.com> References: <44322D43.7090007@synect.com> <9ED4E94C-D911-4F47-9613-D594DA26455D@objectstyle.org> <8f985b960604040647v14974a8di72a5558a9259d254@mail.gmail.com> <44373251.6010604@synect.com> Mime-Version: 1.0 (Apple Message framework v746.3) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: robert@synect.com Content-Transfer-Encoding: 7bit From: Andrus Adamchik Subject: Re: Seeking to automate generation the cayenne schema Date: Sat, 8 Apr 2006 15:13:03 +0400 To: cayenne-user@incubator.apache.org X-Mailer: Apple Mail (2.746.3) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Craig, Here is a few ideas. 1. Your model generator may fit into Cayenne as a new Ant task. We already have a frontend for DbGenerator [1]. Yours will be complimentary to cdbgen. Does anyone know how much trouble it is to accept small (2-3 Java classes) donations @Apache? Hope this doesn't have to go through the Incubator. 2. For now you may keep it either on sourceforge or in your own repository - whatever is convenient to you. 3. An improvement suggestion - take a look at 1.2 AutoAdapter. By using AutoAdapter you won't need to hardcode Cayenne adapter in the code. The correct adapter will be determined dynamically in runtime. [1] http://objectstyle.org/confluence/display/CAYDOC/cdbgen Andrus On Apr 8, 2006, at 7:47 AM, Craig Turner wrote: > 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. >