db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas UNG <thomas....@freesbee.fr>
Subject "inherence" accross 2 differents schemas / reuse some objects from one schema by another one
Date Mon, 19 Feb 2007 15:50:06 GMT
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:

<table name="COUNTRY" idMethod="native">
  <column name="BASEID" type="INTEGER" required="true" javaName="BaseId"
primaryKey="true" autoIncrement="true"/>
  <column name="UNIQUENAME"     .../>
  [+ some others columns ...]
</table>

* In schema B:

  <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"
 />
  </table>

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.apache.org


Mime
View raw message