1 package myorg.entityex.annotated; 2 3 import javax.persistence.*; 4 5 @Entity 6 @Table(name="ENTITYEX_BEAR2") 7 @SecondaryTables({ 8 @SecondaryTable(name="ENTITYEX_BEAR2_NAME"), 9 @SecondaryTable(name="ENTITYEX_BEAR2_ADDRESS") 10 }) 11 public class Bear2 { 12 @Id @GeneratedValue(strategy=GenerationType.IDENTITY) 13 private int id; 14 @Column(table="ENTITYEX_BEAR2_NAME", name="FIRST_NAME", length=16) 15 private String firstName; 16 @Column(table="ENTITYEX_BEAR2_NAME", name="LAST_NAME", length=16) 17 private String lastName; 18 19 @Column(table="ENTITYEX_BEAR2_ADDRESS", name="STREET_NUMBER", length=16) 20 private int streetNumber; 21 @Column(table="ENTITYEX_BEAR2_ADDRESS", name="STREET_NAME", length=16) 22 private String streetName; 23 @Column(table="ENTITYEX_BEAR2_ADDRESS", name="CITY", length=16) 24 private String city; 25 @Column(table="ENTITYEX_BEAR2_ADDRESS", name="STATE", length=16) 26 private String state; 27 28 public int getId() { return id; } 29 public Bear2 setId(int id) { this.id = id; return this; } 30 31 public String getFirstName() { return firstName; } 32 public Bear2 setFirstName(String firstName) { 33 this.firstName = firstName; return this; 34 } 35 36 public String getLastName() { return lastName; } 37 public Bear2 setLastName(String lastName) { 38 this.lastName = lastName; return this; 39 } 40 41 public int getStreetNumber() { return streetNumber; } 42 public Bear2 setStreetNumber(int streetNumber) { 43 this.streetNumber = streetNumber; return this; 44 } 45 46 public String getStreetName() { return streetName; } 47 public Bear2 setStreetName(String streetName) { 48 this.streetName = streetName; return this; 49 } 50 51 public String getCity() { return city; } 52 public Bear2 setCity(String city) { 53 this.city = city; return this; 54 } 55 56 public String getState() { return state; } 57 public Bear2 setState(String state) { 58 this.state = state; return this; 59 } 60 }