Return-Path: X-Original-To: apmail-incubator-empire-db-user-archive@minotaur.apache.org Delivered-To: apmail-incubator-empire-db-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7FE3847BB for ; Wed, 29 Jun 2011 10:31:26 +0000 (UTC) Received: (qmail 5395 invoked by uid 500); 29 Jun 2011 10:31:25 -0000 Delivered-To: apmail-incubator-empire-db-user-archive@incubator.apache.org Received: (qmail 5261 invoked by uid 500); 29 Jun 2011 10:31:19 -0000 Mailing-List: contact empire-db-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: empire-db-user@incubator.apache.org Delivered-To: mailing list empire-db-user@incubator.apache.org Received: (qmail 5224 invoked by uid 99); 29 Jun 2011 10:31:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2011 10:31:14 +0000 X-ASF-Spam-Status: No, hits=3.8 required=5.0 tests=HTML_MESSAGE,RCVD_IN_BRBL_LASTEXT,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [88.79.172.157] (HELO mail.esteam.de) (88.79.172.157) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Jun 2011 10:31:06 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message Subject: re: Relationships MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CC3647.9AC08065" Date: Wed, 29 Jun 2011 12:30:44 +0200 Message-ID: In-Reply-To: <4E0A67DA.5070509@arcor.de> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: re: Relationships Thread-Index: Acw17L0A0gDEuRDsTRe6nj78pWgsrwAWkIbg References: <4E0A67DA.5070509@arcor.de> From: =?iso-8859-1?Q?Rainer_D=F6bele?= To: , Cc: "Matt DeHoust" X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. ------_=_NextPart_001_01CC3647.9AC08065 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi everyone, =20 I think this is an important improvement of the code generator that we = should implement. I have created a Jira Issue for this: =20 https://issues.apache.org/jira/browse/EMPIREDB-110 =20 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. =20 For further discussion I would recommend to move to the dev-mailing = list: empire-db-dev@incubator.apache.org =20 Thanks,=20 Rainer =20 =20 Von: Benjamin Venditti [mailto:benjamin.venditti@arcor.de]=20 Gesendet: Mittwoch, 29. Juni 2011 01:47 An: empire-db-user@incubator.apache.org Cc: Matt DeHoust Betreff: Re: Relationships =20 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:=20 Hello,=20 =20 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.) =20 If not, are there plans to introduce relationship setup in the codegen = component? =20 If not, where should I look to add them myself? CodeGenParser? =20 Thanks, Matt =20 P.S. I apologize if I posted this question twice by mitake. =20 ------_=_NextPart_001_01CC3647.9AC08065 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

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://issue= s.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@incubato= r.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.
          =             &= nbsp;           &n= bsp;           &nb= sp;           &nbs= p;            = ;    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.

 

------_=_NextPart_001_01CC3647.9AC08065--