packagecom.example.myapp.domain;importjava.io.Serializable;importjavax.persistence.*;@EntitypublicclassCityimplementsSerializable { @Id @GeneratedValueprivateLong id; @Column(nullable =false)privateString name; @Column(nullable =false)privateString state;// ... additional members, often include @OneToMany mappingsprotectedCity() {// no-args constructor required by JPA spec// this one is protected since it shouldn't be used directly }publicCity(String name,String state) {this.name= name;this.country= country; }publicStringgetName() {returnthis.name; }publicStringgetState() {returnthis.state; }// ... etc}