Let me re-iterate.
I want to do this (in myproject.schema.html)...
<table name="MY_TABLE">
<column name="ID" required="true" autoIncrement="true" primaryKey="true"
type="INTEGER"/>
<column name="FK_USER_ID" size="255" type="INTEGER"/>
<column name="FOO" size="255" type="VARCHAR"/>
<foreign-key foreignTable="TURBINE_USER">
<reference local="FK_USER_ID" foreign="USER_ID"/>
</foreign-key>
</table>
...but I can't because "ant init" won't let me - says that "TURBINE_USER"
table doesn't exist yet. The build process hasn't built it yet, or
something.
So far the solutions I'm hearing from your are:
1) extending TurbineUser and using the attribute "alias" to prevent double
sql generation and bean properties.
2) redefine the TURBINE_USER table in my application schema
I don't think I want to do either of these. I don't want the stuff in
MY_TABLE to be an 'extension' of the actual Turbine User. I just want to
create a table with a foreign key to TURBINE_USER.USER_ID, and have the same
relationship in my OM.
One solution I found is to not make the foreign-key declaration, just....
<table name="MY_TABLE">
<column name="ID" required="true" autoIncrement="true" primaryKey="true"
type="INTEGER"/>
<column name="FK_USER_ID" size="255" type="INTEGER"/>
<column name="FOO" size="255" type="VARCHAR"/>
</table>
...this works. I get my OM peer just fine. The only thing is I have to
manually populate FK_USER_ID before I insert/update, which me thinks is not
such a terrible idea.
What do you think? Is this good or bad?
(thanks, Philip)
-----Original Message-----
From: Scott Eade [mailto:[EMAIL PROTECTED]]
Sent: Saturday, July 07, 2001 5:44 AM
To: [EMAIL PROTECTED]
Subject: Re: Trying to make foreign key to TURBINE_USER
From: "John McNally" <[EMAIL PROTECTED]>
> you can check out scarab (http://scarab.tigris.org/) for an example of
> extending TurbineUser and using the attribute "alias" to prevent double
> sql generation and bean properties. The approach could use some more
> thought to make it more general, however, and I have not had the time.
>
> john mcnally
I had a look at this, it seems that it is in a state of flux at the moment
(no pun intended). I had a crack at making it work but I ran into
problems because the om classes that exist for the default turbine
tables do not seem to be standard torque generated files (primarily
because TurbineUser does not define getUserId()).
Judging by the comments in CVS there are still some outstanding
issues with the implemented solution.
> Scott Eade wrote:
> > This is the exact thing I am doing. I have a working solution whereby
> > I redefine the TURBINE_USER table in my application schema, but
For the sake of simplicity I think I will stick to this solution for the
moment. It looks like the Scarab authors are trying to include more
flexibility than I need presently need.
Thanks,
Scott
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]