You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Leandro Saad <le...@ibnetwork.com.br> on 2001/07/06 15:37:25 UTC

TORQUE and BO Managers

I think this is a direct message to john mcnally !

I'm working on using torque to generate BO Managers and I have one
question:

When a table is an alias can we presupose that : 
	- there is already sql and java code for it ( so we don't have to
generate it ) ?
	- we can have fk's to this table ?
	- this table shouldn't have fk's to the tables we are describing at
project-schema.xml ?
if the above is correct. why torque generates some code for a table that
has the attribute alias="true" ??

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


Re: TORQUE and BO Managers

Posted by Leandro Saad <le...@ibnetwork.com.br>.
John McNally wrote:

> 
> in this case a class A will be created which extends AParent which is
> the OM class for the table which exists in the other schema.  I am not
> sure how A will already have all the functionality it needs, the usual
> process with torque is to use torque to create the empty classes and the
> classes with the generated methods (BaseA) then to add functionality to
> A.java.
> 
> If you are referring to the ability to use AParent without extending it,
> that might be advantageous in some circumstances though AParent will
> likely not contain all the functionality it needs as it will have no
> knowledge of the classes generated from the new schema.  There still
> might be circumstances where it is preferred to add the needed methods
> manually.  I (and others) would appreciate it if this functionality was
> added to torque.

if we don't extend AParent we have to append all code that is missing ?
it sounds strange. What other alternative do you see ??

> 
> john mcnally
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

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


Re: TORQUE and BO Managers

Posted by John McNally <jm...@collab.net>.
Leandro Saad wrote:
> 
> John McNally wrote:
> >
> > It generates code based on the fk's that other tables are using to
> > reference the alias.
> >
> > <table name=A alias=true>
> > <column name=a pk=true />
> > </table>
> >
> > <table name=B>
> > <column name=b pk=true />
> > <column name=a />
> > <fk table=A>
> >   <localcolumn=a foreigncolumn=b />
> > </fk
> > </table>
> >
> > A.java will have methods like
> >
> 
> Ok. Woudn't be resonable to presupose that A.java has already been
> written with all functionality it needs ?
> 

First my example should read 

<table name=A alias=AParent>

in this case a class A will be created which extends AParent which is
the OM class for the table which exists in the other schema.  I am not
sure how A will already have all the functionality it needs, the usual
process with torque is to use torque to create the empty classes and the
classes with the generated methods (BaseA) then to add functionality to
A.java.

If you are referring to the ability to use AParent without extending it,
that might be advantageous in some circumstances though AParent will
likely not contain all the functionality it needs as it will have no
knowledge of the classes generated from the new schema.  There still
might be circumstances where it is preferred to add the needed methods
manually.  I (and others) would appreciate it if this functionality was
added to torque.

john mcnally

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


Re: TORQUE and BO Managers

Posted by Leandro Saad <le...@ibnetwork.com.br>.
John McNally wrote:
> 
> It generates code based on the fk's that other tables are using to
> reference the alias.
> 
> <table name=A alias=true>
> <column name=a pk=true />
> </table>
> 
> <table name=B>
> <column name=b pk=true />
> <column name=a />
> <fk table=A>
>   <localcolumn=a foreigncolumn=b />
> </fk
> </table>
> 
> A.java will have methods like
> 

Ok. Woudn't be resonable to presupose that A.java has already been
written with all functionality it needs ?


> addB(B b)
> 
> Leandro Saad wrote:
> >
> > I think this is a direct message to john mcnally !
> >
> > I'm working on using torque to generate BO Managers and I have one
> > question:
> >
> > When a table is an alias can we presupose that :
> >         - there is already sql and java code for it ( so we don't have to
> > generate it ) ?
> >         - we can have fk's to this table ?
> >         - this table shouldn't have fk's to the tables we are describing at
> > project-schema.xml ?
> > if the above is correct. why torque generates some code for a table that
> > has the attribute alias="true" ??
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

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


Re: TORQUE and BO Managers

Posted by John McNally <jm...@collab.net>.
It generates code based on the fk's that other tables are using to
reference the alias.

<table name=A alias=true>
<column name=a pk=true />
</table>

<table name=B>
<column name=b pk=true />
<column name=a />
<fk table=A>
  <localcolumn=a foreigncolumn=b />
</fk
</table>

A.java will have methods like
 
addB(B b)


Leandro Saad wrote:
> 
> I think this is a direct message to john mcnally !
> 
> I'm working on using torque to generate BO Managers and I have one
> question:
> 
> When a table is an alias can we presupose that :
>         - there is already sql and java code for it ( so we don't have to
> generate it ) ?
>         - we can have fk's to this table ?
>         - this table shouldn't have fk's to the tables we are describing at
> project-schema.xml ?
> if the above is correct. why torque generates some code for a table that
> has the attribute alias="true" ??
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

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


Re: TORQUE and BO Managers

Posted by John McNally <jm...@collab.net>.
It generates code based on the fk's that other tables are using to
reference the alias.

<table name=A alias=true>
<column name=a pk=true />
</table>

<table name=B>
<column name=b pk=true />
<column name=a />
<fk table=A>
  <localcolumn=a foreigncolumn=b />
</fk
</table>

A.java will have methods like
 
addB(B b)


Leandro Saad wrote:
> 
> I think this is a direct message to john mcnally !
> 
> I'm working on using torque to generate BO Managers and I have one
> question:
> 
> When a table is an alias can we presupose that :
>         - there is already sql and java code for it ( so we don't have to
> generate it ) ?
>         - we can have fk's to this table ?
>         - this table shouldn't have fk's to the tables we are describing at
> project-schema.xml ?
> if the above is correct. why torque generates some code for a table that
> has the attribute alias="true" ??
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

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