db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saravana Krishnan Kannan" <saravkr...@uky.edu>
Subject Re: one-many object mappings
Date Mon, 19 Apr 2004 15:54:39 GMT
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 <rgordon@mwt.net>
To: Apache Torque Users List <torque-user@db.apache.org>
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: 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