Return-Path: X-Original-To: apmail-incubator-empire-db-dev-archive@minotaur.apache.org Delivered-To: apmail-incubator-empire-db-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id A9F1C4C1A for ; Sun, 3 Jul 2011 02:20:38 +0000 (UTC) Received: (qmail 36595 invoked by uid 500); 3 Jul 2011 02:20:38 -0000 Delivered-To: apmail-incubator-empire-db-dev-archive@incubator.apache.org Received: (qmail 36555 invoked by uid 500); 3 Jul 2011 02:20:38 -0000 Mailing-List: contact empire-db-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: empire-db-dev@incubator.apache.org Delivered-To: mailing list empire-db-dev@incubator.apache.org Received: (qmail 36539 invoked by uid 99); 3 Jul 2011 02:20:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jul 2011 02:20:38 +0000 X-ASF-Spam-Status: No, hits=2.2 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of benjamin.venditti@arcor.de designates 151.189.21.45 as permitted sender) Received: from [151.189.21.45] (HELO mail-in-05.arcor-online.net) (151.189.21.45) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 03 Jul 2011 02:20:29 +0000 Received: from mail-in-21-z2.arcor-online.net (mail-in-21-z2.arcor-online.net [151.189.8.185]) by mx.arcor.de (Postfix) with ESMTP id 0CE8BE3D7E; Sun, 3 Jul 2011 04:20:09 +0200 (CEST) Received: from mail-in-11.arcor-online.net (mail-in-11.arcor-online.net [151.189.21.51]) by mail-in-21-z2.arcor-online.net (Postfix) with ESMTP id 03E64ED957; Sun, 3 Jul 2011 04:20:09 +0200 (CEST) Received: from [192.168.1.4] (chello084112121053.15.11.vie.surfer.at [84.112.121.53]) (Authenticated sender: benjamin.venditti@arcor.de) by mail-in-11.arcor-online.net (Postfix) with ESMTPA id 858F035A720; Sun, 3 Jul 2011 04:20:08 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-11.arcor-online.net 858F035A720 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=arcor.de; s=mail-in; t=1309659608; bh=DRfNhtUMQIjAOk4T271ybZ4TK67WIAbMPPem3vToikw=; h=Message-ID:Date:From:MIME-Version:To:Subject:References: In-Reply-To:Content-Type; b=oAYef6TBfPfqKo1EYRPl4qJyIxsGFwVIeq5sgcQzTalhx3yzH406/E3CtUxIM5Qip Zq0U9Z+yACRkqS91TeoV688s6ToDiegJ/YUI8SANkcKP3sjufU00/71FV2x9zuuMbf sAded8KuicrAkKgqvFXfC+5rBp9bmRYswTdN1frc= Message-ID: <4E0FD375.1030303@arcor.de> Date: Sun, 03 Jul 2011 04:27:01 +0200 From: Benjamin Venditti User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: Matt DeHoust , empire-db-dev@incubator.apache.org, empire-db-user@incubator.apache.org Subject: Re: Relationships References: <4E0A67DA.5070509@arcor.de> <4E0F4910.3070707@arcor.de> In-Reply-To: Content-Type: multipart/alternative; boundary="------------080808050408000301050701" X-Virus-Checked: Checked by ClamAV on apache.org --------------080808050408000301050701 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Hi Matt, your testcases will surely be valuable, as i havn't tested my code programatically! I'll have a look at the test cases when you supply them. Cherio Benjamin Am 02.07.2011 23:11, schrieb Matt DeHoust: > Benjamin, > > I had started implementing this feature myself before I saw your > message. The good news is the test case I wrote passes with your > implementation. If you'd like to add the test to the code base, I'd be > happy to attach a patch to the issue. > > I'm going to give it a try against MySQL using the maven plugin. I'll > let you know how it goes. > > Thanks, > Matt > > On Sat, Jul 2, 2011 at 12:36 PM, Benjamin Venditti > > wrote: > > Hi there, > > i just committed a working solution for EMPIREDB-110 the > reverse-engineering of foreign-key relationships. > i'd be happy if anyone could have a look at it. > > > Cherio > Benjamin > > Am 29.06.2011 15:12, schrieb Matt DeHoust: > > Thank you Benjamin and Rainer. I have subscribed to the dev > list. I'll take > > a look at the code when I return from vacation and follow up > using the dev > list with any questions or ideas. I hope to have a chance to > look into it > this weekend. > > -Matt > > On Wed, Jun 29, 2011 at 6:30 AM, Rainer > D�bele> wrote: > > Hi everyone,**** > > ** ** > > I think this is an important improvement of the code > generator that we > should implement.**** > > I have created a Jira Issue for this:**** > > ** ** > > https://issues.apache.org/jira/browse/EMPIREDB-110**** > > ** ** > > Matt, if you feel you can and want to do It, then we would > certainly > appreciate this.**** > > You may create a patch file and attach it to the JIRA > ticket.**** > > Then we can apply the patch and commit the code to svn.**** > > ** ** > > For further discussion I would recommend to move to the > dev-mailing list:* > *** > > empire-db-dev@incubator.apache.org > **** > > ** ** > > Thanks, **** > > Rainer**** > > ** ** > > ** ** > > *Von:* Benjamin Venditti > [mailto:benjamin.venditti@arcor.de > ] > *Gesendet:* Mittwoch, 29. Juni 2011 01:47 > *An:* empire-db-user@incubator.apache.org > > *Cc:* Matt DeHoust > *Betreff:* Re: Relationships**** > > ** ** > > Hi Matt, > > thanks for your interest in empire-db. > > regarding your request ... unfortunately the codegen does > not set up the > relation of the database model. > At the moment the codegen will only set up views and > tables. We thought > these are the most important for the most people as they > are usually > sufficient for simple data access. > > However i think there are two occasions where the > relations are important: > - database creation > - deletion of records with cascading deletion enabled > > At the moment we have not planned to add "relationship > generation" to the > codegen component, but I am glad to hear that you consider > to extend it on > your own. > > The right place to start with that would be: > * CodeGenParser.populateDatabase(..) : 131* : This is > the point where > the DatabaseMetaData is querried and used to populate > empire-db's model > *CodeGenWriter.generateCodeFiles(..) : 125* : Is used > to serialize the > populated model as java code > *src/main/resources/Database.vm : 70* : This is the > velocity template > we use to create the java class for the database. > > In its default constructor you'd need to add a line for > each relationship > similar to this: > > *addRelation( > EMPLOYEES.DEPARTMENT_ID.referenceOn( > DEPARTMENTS.DEPARTMENT_ID ));* > > I hope this is of some help to you. Feel free to ask if > you have further > questions! > > Cherio > Benjamin > > Am 28.06.2011 19:37, schrieb Matt DeHoust: **** > > Hello, **** > > ** ** > > I see that the empire-db model supports relationships (for > example > DBDatabase.getRelations()), but it doesn't seem that the > codegen component > sets them up. Am I missing something? (I am using MySQL if > that matters.)* > *** > > ** ** > > If not, are there plans to introduce relationship setup in > the codegen > component?**** > > ** ** > > If not, where should I look to add them myself? > CodeGenParser?**** > > ** ** > > Thanks,**** > > Matt**** > > ** ** > > P.S. I apologize if I posted this question twice by > mitake.**** > > ** ** > > > --------------080808050408000301050701--