Return-Path: Delivered-To: apmail-db-torque-user-archive@www.apache.org Received: (qmail 52501 invoked from network); 25 Jun 2007 07:37:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Jun 2007 07:37:53 -0000 Received: (qmail 89950 invoked by uid 500); 25 Jun 2007 07:37:56 -0000 Delivered-To: apmail-db-torque-user-archive@db.apache.org Received: (qmail 89921 invoked by uid 500); 25 Jun 2007 07:37:56 -0000 Mailing-List: contact torque-user-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Apache Torque Users List" Reply-To: "Apache Torque Users List" Delivered-To: mailing list torque-user@db.apache.org Received: (qmail 81054 invoked by uid 99); 25 Jun 2007 07:32:53 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) X-Virus-Scanned: amavisd-new at bbeyond.nl X-Virus-Scanned: amavisd-new at Date: Mon, 25 Jun 2007 09:32:23 +0200 (CEST) From: "Wieger Uffink [Us Media]" To: Apache Torque Users List Cc: torque-user@db.apache.org Message-ID: <27941254.60921182756743772.JavaMail.root@vault.usmedia.nep> In-Reply-To: <11260581.post@talk.nabble.com> Subject: Re: "inherence" accross 2 differents schemas / reuse some objects from one schema by another one MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [82.92.173.52] X-Virus-Checked: Checked by ClamAV on apache.org Hi, I see your point. I would prefer the external-schema route. If you have separate package names for the core and dependent schemas it should be easy enough to remove the core classes after generating the object model, either manually or by using a build script, but it's not a very elegant solution... I don't think there is a 'skipJava' option in the schema, the equivalent of 'skipSql' but something like that would solve your issue, and should not be too hard to hack into the templates. HTH Wieger -- Us Media Stadhouderskade 115 1073 AX Amsterdam t: +31 20 428 6868 f: +31 20 470 6905 w: http://www.usmedia.nl ----- Original Message ----- From: "kstone" To: torque-user@db.apache.org Sent: Friday, June 22, 2007 11:48:18 PM (GMT+0100) Europe/Berlin Subject: Re: "inherence" accross 2 differents schemas / reuse some objects from one schema by another one I see a need to do this myself. Wieger, we are doing something like you suggested with one hitch.... Basically, we have a core application which is like a jumpstart application. It contains all of the security DB tables etc.We have 3 dependent apps on the core and many future ones in design that will need to use all of this functionality. So far jarring up the CORE and sending to other apps is fine. Except when I need a FK to one of the core tables from the dependentapp-schema.xml. Then we have to duplicate this core table entry in the dependentapp-schema.xml. This causes two identical classes(one in jar and one in dependent app) to be produced which creates a mess. Using the external-schema element creates even a bigger mess b/c it recreates all of the core om classes in the dependent app. We want to eliminate the core classes from being edited in the dependent app code base. Only persons who understand how this could affect all apps should be diving in here. Any more ideas? Thanks! KStone wieger wrote: > > Hi Thomas, > > When I have two or more web-applications who access the same database I > usually create a separate jar which contains the generated torque > classes, and perhaps some other shared classes, and include this in each > my web-applications. This way you have only one schema file and one set > of Torque models to maintain. > Not sure if this is 'best practice' but it works pretty well. > > Kind regards, > Wieger > -- > Us Media > Stadhouderskade 115 > 1073 AX Amsterdam > > t: +31 20 428 6868 > f: +31 20 470 6905 > w: http://www.usmedia.nl > > > ----- Original Message ----- > From: "Thomas UNG" > To: torque-user@db.apache.org > Sent: Monday, February 19, 2007 4:50:06 PM (GMT+0100) Europe/Berlin > Subject: "inherence" accross 2 differents schemas / reuse some objects > from one schema by another one > > Hi, > > I have some questions related to two different webapps sharing the same > schema. > > Let's say that I ve two webapps A and B pointing to the same DB and the > B have the om classes generated by the webapp A in its lib directory. > > * In schema A: > > > primaryKey="true" autoIncrement="true"/> > > [+ some others columns ...] >
> > * In schema B: > > baseClass="A.om.Country" > basePeer="A.om.CountryPeer" > skipSql="true"> > required="true" javaName="BaseId" primaryKey="true" autoIncrement="true" > /> >
> > In the classes generated by torque in webapp B, I do have the following: > > B.com.Country.getUniqueName() > > getUniqueName() is a method inherited from A.om.Country > > However, this method returns null because 'uniquename' is a private > attribute and torque only do the following selection: > > SELECT COUNTRY.BASEID FROM COUNTRY WHERE COUNTRY.BASEID=73 > > So I do have 2 workarrounds: > - add "UniqueName" column in B schema > - or get the id and use it to retrieve A.om.Country object to get all > fields. > > Can anyone tell me what is the best practices? > > Thanks in advance, > Thomas UNG > > I am using torque 3.1.1 with turbine 2.3.2 > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apach > > --------------------------------------------------------------------- > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org > For additional commands, e-mail: torque-user-help@db.apache.org > -- View this message in context: http://www.nabble.com/%22inherence%22-accross-2-differents-schemas---reuse-some-objects-from-one-schema-by-another-one-tf3253557.html#a11260581 Sent from the Apache DB - Torque Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org For additional commands, e-mail: torque-user-help@db.apache.org