db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <cct...@cityarchitect.co.uk>
Subject RE: Simple Join
Date Sun, 21 Dec 2003 00:34:23 GMT
Sonu,

Try:
    	Criteria c = new Criteria();
   	c.addJoin(PitcherPeer.TEAM_ID, TeamPeer.TEAM_ID);
	List pitchers = PitcherPeer.doSelect(c);
      Pitcher p1 = (Pitcher)pitchers.get(0);
	Team team = p1.getTeam();

Steve

From: Sonu Vijay [mailto:sonupv@yahoo.com]
Sent: 19 December 2003 22:46
To: Apache Torque Users List
Subject: Simple Join


I need to do a simple select with join.

Select * from Pitcher join Team on Pitcher.TEAM_ID =
TEAM.TEAM_ID ;

Following one of the "Peers How To" tutorials I was
trying to do the following but the program just hangs
at the line:

List pitchers = PitcherPeer.doSelectJoinTeam(c);

and doesn't do anything

--------Code-------------------------------------
        Criteria c = new Criteria();
	(System.out.println"riteria : "+ c);
       List pitchers =
PitcherPeer.doSelectJoinTeam(c);
        Pitcher p1 = (Pitcher)list.get(0);
	Team team = p1.getTeam();
	ystem.out.println("Name of the Pitchers and his team:
"+ p1.getLastName()+" "+p1.getFirstName()+" "
+p1.getTeamId() + " " +team.getTeamName());

----------------------------------------------

Any ideas

Thanks
	

__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

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