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:[EMAIL PROTECTED]
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: [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