1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | @Entity @Table (name= "your_entity" ) public class YourEntity extends BaseObject implements Serializable { private Long yourEntityId; private String name; private String description; private Date startDate; public YourEntity() { } @Id @GeneratedValue (strategy = GenerationType.AUTO) @Column (name = "education_id" ) public Long getYourEntityId() { return yourEntityId; } public void setEducationId(Long educationId) { this .educationId = educationId; } public String getName() { return name; } public void setName(String name) { this .name = name; } public String getDescription() { return description; } public void setDescription(String description) { this .description = description; } @Temporal (javax.persistence.TemporalType.DATE) @Column (name = "start_date" ) public Date getStartDate() { return startDate; } public void setStartDate(Date startDate) { this .startDate = startDate; } @Override public int hashCode() { int hash = 7 ; hash = 19 * hash + ( this .name != null ? this .name.hashCode() : 0 ); hash = 19 * hash + ( this .description != null ? this .description.hashCode() : 0 ); hash = 19 * hash + ( this .startDate != null ? this .startDate.hashCode() : 0 ); return hash; } @Override public boolean equals(Object obj) { if (obj == null ) { return false ; } if (getClass() != obj.getClass()) { return false ; } final Education other = (Education) obj; if (( this .name == null ) ? (other.name != null ) : ! this .name.equals(other.name)) { return false ; } if (( this .description == null ) ? (other.description != null ) : ! this .description.equals(other.description)) { return false ; } if ( this .startDate != other.startDate && ( this .startDate == null || ! this .startDate.equals(other.startDate))) { return false ; } return true ; } @Override public String toString() { return "Education{" + "educationId=" + educationId + ", name=" + name + ", description=" + description + ", startDate=" + startDate + '}' ; } } |