View Javadoc
1   package myorg.entityex.annotated;
2   
3   import javax.persistence.AttributeOverride;
4   import javax.persistence.AttributeOverrides;
5   import javax.persistence.Column;
6   import javax.persistence.Embeddable;
7   
8   @Embeddable
9   public class Address {
10  	@AttributeOverrides({
11  		@AttributeOverride(name="number", column=@Column(name="STREET_NUMBER")),
12  	})
13  	private Street street; //a second level of embedded
14  	@Column(name="CITY", length=16)
15  	private String city;
16  	@Column(name="STATE", length=16)
17  	private String state;
18  
19  	public Street getStreet() { return street; }
20  	public Address setStreet(Street street) { this.street = street; return this; }
21  	
22  	public String getCity() { return city; }
23  	public Address setCity(String city) { this.city = city; return this; }
24  	
25  	public String getState() { return state; }
26  	public Address setState(String state) { this.state = state; return this; }
27  }