View Javadoc
1   package myorg.entityex.annotated;
2   
3   import javax.persistence.*;
4   
5   @Entity
6   @Table(name="ENTITYEX_BEAR")
7   public class Bear {
8   	@Id
9   	@GeneratedValue(strategy=GenerationType.IDENTITY)
10  	private int id;
11  	@AttributeOverrides({
12  		@AttributeOverride(name="lastName", column=@Column(name="LAST_NAME", length=16))
13  	})
14  	@Embedded
15  	private Name name;
16  	@AttributeOverrides({
17  		@AttributeOverride(name="street.name", column=@Column(name="STREET_NAME", length=16)),
18  	})
19  	@Embedded
20  	private Address address;
21  	
22  	public int getId() { return id; }
23  	public void setId(int id) {
24  		this.id = id;
25  	}
26  	
27  	public Name getName() { return name; }
28  	public void setName(Name name) {
29  		this.name = name;
30  	}
31  	
32  	public Address getAddress() { return address; }
33  	public void setAddress(Address address) {
34  		this.address = address;
35  	}
36  }