View Javadoc
1   package ejava.jpa.examples.cache;
2   
3   import javax.persistence.Cacheable;
4   import javax.persistence.Column;
5   import javax.persistence.Entity;
6   import javax.persistence.GeneratedValue;
7   import javax.persistence.Id;
8   import javax.persistence.Table;
9   
10  @Entity
11  @Table(name="JPACACHE_ADDRESS")
12  @Cacheable(false)
13  public class Address {
14  	@Id @GeneratedValue
15  	private int id;
16  	@Column(length=32)
17  	private String street;
18  	@Column(length=32)
19  	private String city;
20  	@Column(length=2)
21  	private String state;
22  	@Column(length=10)
23  	private String zip;
24  	
25  	public Address() {}
26  	public Address(int id) { this.id=id; }	
27  	public int getId()     { return id; }
28  	
29  	public String getStreet() { return street; }
30  	public void setStreet(String street) {
31  		this.street = street;
32  	}
33  	
34  	public String getCity() { return city; }
35  	public void setCity(String city) {
36  		this.city = city;
37  	}
38  	
39  	public String getState() { return state; }
40  	public void setState(String state) {
41  		this.state = state;
42  	}
43  	
44  	public String getZip() { return zip; }
45  	public void setZip(String zip) {
46  		this.zip = zip;
47  	}
48  	
49  	@Override
50  	public String toString() {
51  		return street + " " + city + " " + state + ", " + zip;
52  	}
53  	
54  }