You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Jim Menard <ji...@io.com> on 2003/12/18 17:18:00 UTC

Saving related objects

I want to make sure I understand a few basic points about using Torque.

When I save an object, it does not save any related objects, correct? 
For example,

	BillAccount account = new BillAccount();
	Address address = new Address();
	account.setAddress(address);

	account.save();		// This does NOT save the address, right?

Likewise, with deletes I have to manually delete related objects, 
correct? (I have not yet experimented with specifying foreign key 
onUpdate and onDelete values.)

Thank you for your help.

Jim
-- 
Jim Menard, jimm@io.com, http://www.io.com/~jimm/
"You will notice that BeOS has taken the best parts from all the major
operating systems and made them its own. We've got the power of the
Unix command line, the ease of use of the Macintosh interface, and
Minesweeper from Windows." -- Tyler Riti


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


Re: Saving related objects

Posted by Scott Eade <se...@backstagetech.com.au>.
Jim Menard wrote:

> I want to make sure I understand a few basic points about using Torque.
>
> When I save an object, it does not save any related objects, correct? 
> For example,
>
>     BillAccount account = new BillAccount();
>     Address address = new Address();
>     account.setAddress(address);
>
>     account.save();        // This does NOT save the address, right?

Wrong - Torque WILL save the related address.

>
> Likewise, with deletes I have to manually delete related objects, 
> correct? (I have not yet experimented with specifying foreign key 
> onUpdate and onDelete values.)

I haven't tried these either, but in any case they will depend on the 
availability of these features in the underlying RDBMS (i.e. don't 
expect them to work for MySQL).

Scott

-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au





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