db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "wieger" <wie...@usmedia.nl>
Subject Re: "inherence" accross 2 differents schemas / reuse some objects from one schema by another one
Date Tue, 20 Feb 2007 10:19:15 GMT
Hi Thomas,

Is there a specific reason why you need to have two separate classes A.om.Country and B.om.Country
and two schemas?
Personally I cannot see a reason why you would need this, both are essentially accessing the
same database table right?
Perhaps you can explain this?

My suggestion would be to create a new package, say C, and include C.om.Country in both your
webapps.
Any extra code that you don't want shared across applications you can then put in classes
A.model.Country
and B.model.Country or something like that, and have those encapsulate,extend or simply import
the omclasses from package C.

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" <thomas.ung@freesbee.fr>
To: torque-user@db.apache.org
Sent: Monday, February 19, 2007 8:25:28 PM (GMT+0100) Europe/Berlin
Subject: Re: "inherence" accross 2 differents schemas / reuse some objects from one schema
by another one

Hi Wieger,

Thanks for your answer! This is exactly what I did. But the point is
that the B schema only contains the primary key of the entire table
specified in schema A. But B has the following properties:

baseClass="A.om.Country"
basePeer="A.om.CountryPeer"

From the generated B om classes, they inherit A methods but all of them
return null because they don't contain the specific columns in B schema.

So my point is to wonder what is the best thing to use:

- add A columns in B schema instead of having simply the following:
<table name="COUNTRY"
 baseClass="A.om.Country"
 basePeer="A.om.CountryPeer"
 skipSql="true">
 <column name="BASEID" type="INTEGER" required="true" javaName="BaseId"
primaryKey="true" autoIncrement="true"/>

- or get the id from B and use it to retrieve the A.om.Country object to
get all fields.

- or maybe is there something else to do?

Best Regards,
Thomas


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

Mime
View raw message