FileDocCategorySizeDatePackage
PetDAOBean.javaAPI DocJBoss 4.2.11984Fri Jul 13 20:55:08 BST 2007org.jboss.tutorial.singleinheritance.bean

PetDAOBean

public class PetDAOBean extends Object implements PetDAO

Fields Summary
private EntityManager
manager
Constructors Summary
Methods Summary
public voidcreateCat(java.lang.String name, double weight, int lives)

      Cat cat = new Cat();
      cat.setName(name);
      cat.setWeight(weight);
      cat.setHairball("#$@#%@");
      manager.persist(cat);
   
public voidcreateDog(java.lang.String name, double weight, int bones)

      Dog dog = new Dog();
      dog.setName(name);
      dog.setWeight(weight);
      dog.setTrick("Sit");
      manager.persist(dog);
   
public java.util.ListfindByWeight(double weight)

      return manager.createQuery("from Pet p where p.weight < :weight").setParameter("weight", weight).getResultList();