db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From T E Schmitz <mail...@numerixtechnology.de>
Subject Re: AW: Saving associated objects
Date Wed, 08 Dec 2004 18:06:06 GMT
Hi Sarav,

Saravana Krishnan wrote:

> My other doubt is, if it's a 1:1 relation between 2 tables, why not
> simply merge them? What's the point in having 2 tables with 1:1
> relations.

I can think of two examples:

1) You might have two entities that require address data. You don't want 
to dupicate the address structure. The address relates to exactly one 
row in one of the two tables.

2) You use Torque and you have an entity which has an associated image 
per row. The auto-generated code fetches *every* attribute of a table. 
But you certainly don't want to read the images each time you doSelect n 
records. I have such a case: I store the image in a separate table 
PICTURE. In the application, the user can choose search criteria to 
display a list of PRODUCTs, might be 1000+ records. When he 
double-clicks a row, he gets the detail view with the PICTURE.



Tarlika Elisabeth Schmitz

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

View raw message