Last active
March 9, 2020 01:06
-
-
Save c3l3si4n/8d18f789f7dc55f425edaef6fdfabb18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity | |
public class Customer { | |
@Id | |
@GeneratedValue(strategy=GenerationType.AUTO) | |
private Long id; | |
private String firstName; | |
private String lastName; | |
@Unique | |
private String identityNumber; | |
private Calendar birthDate; | |
protected Customer() {} | |
public Customer(String firstName, String lastName, String identityNumber, Calendar birthDate) { | |
this.firstName = firstName; | |
this.lastName = lastName; | |
this.identityNumber = identityNumber; | |
this.birthDate = birthDate; | |
} | |
@Override | |
public String toString() { | |
return String.format( | |
"Customer[id=%d, firstName='%s', lastName='%s']", | |
id, firstName, lastName); | |
} | |
public Long getId() { | |
return id; | |
} | |
public String getFirstName() { | |
return firstName; | |
} | |
public String getLastName() { | |
return lastName; | |
} | |
public String getIdentificationNumber() { | |
return identificationNumber; | |
} | |
public Calendar getBirthDate() { | |
return birthDate; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment