You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Fabrice Depoux <fd...@imediation.com> on 2001/10/19 19:17:04 UTC

[Torque] alias attribute in table definition

I have the following torque xml schema definition:
<database package="com.imediation.om" >
  <table name="PERMISSION" javaName="TurbinePermission"
alias="TurbinePermission"
	basePeer="org.apache.turbine.om.security.peer.PermissionPeer"
	baseClass="org.apache.turbine.om.security.TurbinePermission"> 
	<column name="PERMISSION_ID" primaryKey="true" required="true"
type="INTEGER"/>
  </table>
  <table name="OPERATION" idMethod="idbroker">
	<column name="OPERATION_ID" required="true" autoIncrement="true"
primaryKey="true" type="INTEGER"/>
	<foreign-key foreignTable="PERMISSION">
		<reference local="PERMISSION_ID" foreign="PERMISSION_ID"/>
	</foreign-key>
  </table>
</database>

The use of the "alias" attribute in the PERMISSION table definition avoids
the generation of the sql code corresponding to the creation of the table.
But the corresponding java classes (Object, Peer, ExtensionObject and
PeerObject) are generated.

I would like to know if there is any good reason for generating theses
classes? If not, is it possible to block the creation of theses classes?

Thanks,

Fabrice.

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


Re: [Torque] alias attribute in table definition

Posted by John McNally <jm...@collab.net>.
The relationships with other objects are written into the classes that
are generated.  Other object will have methods that use these classes. 
They cannot be thrown away.  If you really need the fk relationship in
the sql, but you do not want your objects to contain this info.  You
will have to generate your sql and then comment out the fk tags in your
schema before generating the om.

john mcnally

Fabrice Depoux wrote:
> 
> I have the following torque xml schema definition:
> <database package="com.imediation.om" >
>   <table name="PERMISSION" javaName="TurbinePermission"
> alias="TurbinePermission"
>         basePeer="org.apache.turbine.om.security.peer.PermissionPeer"
>         baseClass="org.apache.turbine.om.security.TurbinePermission">
>         <column name="PERMISSION_ID" primaryKey="true" required="true"
> type="INTEGER"/>
>   </table>
>   <table name="OPERATION" idMethod="idbroker">
>         <column name="OPERATION_ID" required="true" autoIncrement="true"
> primaryKey="true" type="INTEGER"/>
>         <foreign-key foreignTable="PERMISSION">
>                 <reference local="PERMISSION_ID" foreign="PERMISSION_ID"/>
>         </foreign-key>
>   </table>
> </database>
> 
> The use of the "alias" attribute in the PERMISSION table definition avoids
> the generation of the sql code corresponding to the creation of the table.
> But the corresponding java classes (Object, Peer, ExtensionObject and
> PeerObject) are generated.
> 
> I would like to know if there is any good reason for generating theses
> classes? If not, is it possible to block the creation of theses classes?
> 
> Thanks,
> 
> Fabrice.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-user-help@jakarta.apache.org

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