db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raphael Mankin <r...@mankin.org.uk>
Subject RE: [Slightly OT] one-to-one relation
Date Sun, 03 Jul 2005 09:31:08 GMT
I seem to remember the line 'they shall cleave together and be of one flesh' ;-)




On 01-Jul-2005 Alvaro Coronel wrote:
> Hello Raphael, couldn't resist answering your question. I am a married man,
> and I sure look forward to have a 1:1 relation between clearly differentiated
> "objects" (i.e. persons) :)
>  
> Best regards everyone,
>  
> Álvaro Coronel.
> 
> Raphael Mankin <raph@mankin.org.uk> wrote:
> 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" 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
> 
> 
>               
> ---------------------------------
> Yahoo! Mail
>  Stay connected, organized, and protected. Take the tour

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


Mime
View raw message