View Javadoc
1   package ejava.examples.orm.core.annotated;
2   
3   import javax.persistence.*;
4   
5   /**
6    * This class provides an example of an object with no identity of its own
7    * and must be stored within a containing object. See the XRay class for
8    * an example of a containing object.
9    */
10  @Embeddable
11  public class Manufacturer {
12      private String name;
13      private String address;
14      private String phone;
15      
16      public Manufacturer() {}
17      public Manufacturer(String name, String address, String phone) {
18          this.name = name;
19          this.address = address;
20          this.phone=phone;
21      }
22      
23      public String getAddress() { return address; }
24      public void setAddress(String address) {
25          this.address = address;
26      }
27  
28      public String getName() { return name; }
29      public void setName(String name) {
30          this.name = name;
31      }
32  
33      public String getPhone() { return phone; }
34      public void setPhone(String phone) {
35          this.phone = phone;
36      }
37      
38      public String toString() {
39          return new StringBuilder()
40             .append(super.getClass().getName())
41             .append(", name=").append(name)
42             .append(", address=").append(address)
43             .append(", phone=").append(phone)
44             .toString();        
45      }
46  }