1 7 package org.jboss.tutorial.composite.client; 8 9 import org.jboss.tutorial.composite.bean.Customer; 10 import org.jboss.tutorial.composite.bean.EntityTest; 11 import org.jboss.tutorial.composite.bean.Flight; 12 13 import javax.naming.InitialContext ; 14 15 21 public class Client 22 { 23 public static void main(String [] args) throws Exception 24 { 25 InitialContext ctx = new InitialContext (); 26 EntityTest test = (EntityTest) ctx.lookup(EntityTest.class.getName()); 27 test.manyToManyCreate(); 28 29 Flight one = test.findFlightById(new Long (1)); 30 31 Flight two = test.findFlightById(new Long (2)); 32 33 System.out.println("Air France customers"); 34 for (Customer c : one.getCustomers()) 35 { 36 System.out.println(c.getName()); 37 38 } 39 System.out.println("USAir customers"); 40 41 for (Customer c : two.getCustomers()) 42 { 43 System.out.println(c.getName()); 44 } 45 46 } 47 } 48 | Popular Tags |