package tutorial.persistence; import javax.persistence.*; /** * Extension of Animal class illustrating inheritance. */ @Entity(name = "Dog") public class Dog extends Animal { public Dog(String name, float price) { super(name, price); } public String toString(boolean detailed) { // this implementation ignores the 'detailed' flag StringBuffer buf = new StringBuffer(60); buf.append("Dog ").append(getName()); buf.append(" costs ").append(getPrice()).append(" dollars."); return buf.toString(); } }