db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: <foreign-key> to another db
Date Wed, 31 Aug 2005 07:38:35 GMT




Greg, are you sure that you are not caught by the (confusing) overloading
of the word "schema" in torque ?
It can either mean the schema.xml files or the database schema.

Mickey meant (in my opinon) by "db2" the <database name="db2"> defined in
another schema.xml file  and not the database schema db2 (but maybe I'm
wong). And if that is the case, the problem is that the generator processes
the schema.xml one after another, so a reference to another schema.xml has
no meaning inside the schema.xml which is processed at the moment.

In 3.2-RC1, generation time database schema support should work, meaning
that you can have references to different database schemata in one
schema.xml. You can also specify foreign keys between them, and I would
guess that the generated code makes sense (though I never tried it), but as
you wrote, whether this works depends on the database.

As of creating the tables in a foreign schema, this works if the database
supports it (e.g. Oracle does). If I am connected as user1 (and thus my
default schema is user1), I can nevertheless create the table
user2.sometable if I have the permissions for it. But I am also sure that
there are databases where this will not work.

    Thomas



"Greg Monroe" <Greg.Monroe@DukeCE.com> schrieb am 31.08.2005 00:07:51:

> I wonder if this is too SQL implimentation specific?  I know that MS SQL
> doesn't support it and I'm pretty sure that My SQL doesn't either.  How
> would you handle writing the table creation SQL scripts from the XML in
> these cases if the input XML specifies foreign DB keys?
>
> But then I'm looking at it from the point of needing cross-DB type code.
> If it can support both cases in some way, great.
>
> > -----Original Message-----
> > From: Thomas Fischer [mailto:tfischer@apache.org]
> > Sent: Tuesday, August 30, 2005 4:15 PM
> > To: Apache Torque Developers List
> > Subject: Re: <foreign-key> to another db
> >
> >
> > Hi,
> >
> > I'm not totally sure, but I would guess this does not work.
> > However, with
> > 3.2-RC1, there is the possibility to include one schema into
> > another. I
> > have never used it, but it might work then (I would try it
> > without using
> > the db2 prefix)
> >
> >     Thomas
> >
> > On Sun, 28 Aug 2005, Mickey Mokotov wrote:
> >
> > > Hi All,
> > >
> > > Can in any way we support the <foreign-key> tag to
> > reference another
> > > db? for example:
> > >
> > > <database name="db1">
> > >
> > >  <table name="t1">
> > >    <column name="userId" type="INTEGER" primaryKey="true"
> > > autoIncrement="true"/>
> > >    <column name="countryId" type="INTEGER"/>
> > >    <foreign-key foreignTable="db2.Country">
> > >      <reference local="countryKey" foreign="symbol"/>
> > >    </foreign-key>
> > >  </table>
> > >
> > > </database>
> > >
> > >
> > > --
> > > <http://www.fetchbook.info/> www.FetchBook.Info
> > > Find the lowest price - Compare more then a hundred book
> > stores in a click.
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-dev-help@db.apache.org
> >
> >
>
> Duke CE Privacy Statement
> Please be advised that this e-mail and any files transmitted with it
> are confidential communication or may otherwise be privileged or
> confidential and are intended solely for the individual or entity to
> whom they are addressed.  If you are not the intended recipient you
> may not rely on the contents of this email or any attachments, and
> we ask that you  please not read, copy or retransmit this
> communication, but reply to the sender and destroy the email, its
> contents, and all copies thereof immediately.  Any unauthorized
> dissemination, distribution or copying of this communication is
> strictly prohibited.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>


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


Mime
View raw message