db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: one-to-one relation
Date Fri, 01 Jul 2005 14:53:59 GMT




Hi,

there are several reasons why one may want a 1:1 relation
- the data belongs to logical different entities. Maybe later one wants to
release te 1:1 relation
- part of the data in a table is expensive to read but is not always
needed. Torque always reads the whole column.

         Thomas

"Raphael Mankin,,," <raph@webwright-uk.com> schrieb am 01.07.2005 16:10:24:

> Make the FK a unique attribute, then there can be only one 'child' of a
given
> parent.
>
>
> But why do you want a 1:1 at all? Surely if two objects are 1:1 then they
are
> two parts of the same object -- unless one part is optional.
>
>
>
> On 01-Jul-2005 Thomas Fischer wrote:
> >
> >
> >
> >
> > Hi,
> >
> > 1:1 and n:m relations are not supported out of the box by Torque, as
far as
> > I know.
> >
> > However, as a 1:1 relation is a special case of a 1:n relation, there
> > should be no real problems there. Only thing you have to do is verify
that
> > one object is referenced only by one other object. You can e.g.
> > - override the setter methods to allow only one Element
> > - add a unique constarint to the foreign key in the db
> >
> >    Thomas
> >
> > "Rafael Coscolla" <rcoscolla@tissat.es> schrieb am 01.07.2005 14:10:36:
> >
> >> Hi,
> >>
> >>
> >>
> >> does anyone know how to implement a one-to-one relation between two
> >> tables with torque?.
> >>
> >>
> >>
> >> I hoped to find an attribute, in the foreign key element of the torque
> >> schema, to indicate the cardinality (one-too-many is created by
default)
> >> of the relation but I haven't found it.
> >>
> >>
> >>
> >>
> >>
> >> Thanks in advance !!
> >>
> >>
> >>
> >> Rafa
> >>
> >>
> >>
> >
>
------------------------------------------------------------------------------

> > ------------------------------------------------------
> >
> >> Nota Legal: Este correo electronico puede contener informacion
> >> estrictamente confidencial y es de uso exclusivo del destinatario,
> >> quedando prohibida a cualquier otra persona su revelacion, copia,
> >> distribucion, o el ejercicio de cualquier accion relativa a su
> >> contenido. Si ha recibido este correo electronico por error, por
> >> favor, conteste al remitente, y posteriormente proceda a borrarlo de
> >> su sistema. Gracias por su colaboracion.
> >>
> >> Confidentiality notice: This e-mail message may contain confidential
> >> and/or legally privileged information and is solely for the
> >> attention and use of the intended recipient. Any disclosure,
> >> copying, distribution or the taking of any action with relation to
> >> the contents of this e-mail by any other person is strictly
> >> prohibited. If you believe that this e-mail has been mistakenly sent
> >> to you, please reply to the sender from whom you received the
> >> message in error and then delete the original e-mail from your
> >> system. Thank you for your co-operation.
> >>
> >
>
------------------------------------------------------------------------------

> > ------------------------------------------------------
> >
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> > For additional commands, e-mail: torque-user-help@db.apache.org
>
> --
>                                Lead us not into temptation; we
>                                can find our own way.
>
>
> Raphael Mankin
> ----------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


---------------------------------------------------------------------
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