FileDocCategorySizeDatePackage
PetDAOBean.javaAPI DocJBoss 4.2.12028Fri Jul 13 20:55:22 BST 2007org.jboss.tutorial.tableperinheritance.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.setLives(lives);
      manager.persist(cat);
   
public voidcreateDog(java.lang.String name, double weight, int bones)

      Dog dog = new Dog();
      dog.setName(name);
      dog.setWeight(weight);
      dog.setNumBones(bones);
      manager.persist(dog);
   
public java.util.ListfindByWeight(double weight)

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