1 7 package org.jboss.tutorial.joininheritance.Client; 8 9 import org.jboss.tutorial.joininheritance.bean.Pet; 10 import org.jboss.tutorial.joininheritance.bean.PetDAO; 11 12 import javax.naming.InitialContext ; 13 14 import java.util.List ; 15 16 22 public class Client 23 { 24 public static void main(String [] args) throws Exception 25 { 26 InitialContext ctx = new InitialContext (); 27 PetDAO dao = (PetDAO) ctx.lookup(PetDAO.class.getName()); 28 29 dao.createCat("Toonses", 15.0, 9); 30 dao.createCat("Sox", 10.0, 5); 31 dao.createDog("Winnie", 70.0, 5); 32 dao.createDog("Junior", 11.0, 1); 33 34 List l = dao.findByWeight(14.0); 35 for (Object o : l) 36 { 37 System.out.println(((Pet) o).getName()); 38 } 39 } 40 } 41 | Popular Tags |