db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "thomas.ung@freesbee.fr" <thomas....@freesbee.fr>
Subject Re: "inherence" accross 2 differents schemas / reuse some objects from one schema by another one
Date Tue, 20 Feb 2007 11:45:32 GMT
Hi Wieger,

I did not thought about solution C lol. Well the fact having "dependencies" from schema B
to A is because the webapp B has some other tables having relationship with it, let's say,
the A.om.Country

The om generator will stop if you specify a foreign key that cannot be found in the same schema?
right? That's the reason why I specify the same table B.om.Country but only with the primary
key and the properties baseClass="A.om.Country" basePeer="A.om.CountryPeer"
 skipSql="true"

The fonctionnal reason having webapps pointing to the same db is that they share a small amounth
of data such user authentication .. They are modules having different features. We want them
completly independant. 

Many thanks for your thoughts,
Best regards,
Thomas



---------- Initial Header -----------

From      : "wieger" <wieger@usmedia.nl>
To          : "torque-user" <torque-user@db.apache.org>
Cc          : 
Date      : Tue, 20 Feb 2007 10:19:15 GMT
Subject : Re: "inherence" accross 2 differents schemas / reuse some objects from one schema
by another one

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


--------------------- ALICE SECURITE ENFANTS ---------------------
Protégez vos enfants des dangers d'Internet en installant Sécurité Enfants, le contrôle
parental d'Alice.
http://www.aliceadsl.fr/securitepc/default_copa.asp



---------------------------------------------------------------------
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