Hi,

  Sorry about the previous message with just a "Hi"

  First I will explain what I understand of your question -
You have an entity X which has many Y refering to it 
through a foreign key in Y. And you want to get all Y's 
that refer to X as a List.

  It THAT is what you wanted, there is already one such
function available in Torque. You can do X.getYs() and
it will return a List of all Ys that refer to X. This IS a "s" after the "Y" in the 
function name. You can then do something like this-

List Ylist = X.getYs();
Iterator i = Ylist.iterator();
while (i.hasNext())
{
 Y yobj = (Y) i.next();
 /* Do something in yobj. */
}

Hope this helps.

~Sarav

-----Original Message-----
From: Rob Gordon <[EMAIL PROTECTED]>
To: Apache Torque Users List <[EMAIL PROTECTED]>
Date: Mon, 19 Apr 2004 08:55:59 -0500
Subject: one-many object mappings

Hi--

Anyone have any experience with one-many mappings in schema?
Is it possible?  Basically, I want  something like getBasedOnForeignKey
to return a List, not a single object.

Rob



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to