Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- @NamedQuery(name = "Customer.getAll", query = "SELECT c FROM Customer c")
- @SequenceGenerator(name = "SEQ_CUST", initialValue = 50)
- public class Customer {
- // ======================================
- // = Attributes =
- // ======================================
- @Id
- @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_CUST")
- @Cascade(CascadeType.ALL)
- @Column(name = "FK_CUSTOMER")
- private int id;
- @NotNull
- private String firstName;
- @NotNull
- private String lastName;
- @NotNull
- private String email;
- @NotNull
- private String phoneNumber;
- @NotNull
- private Date birth;
- public Customer(){
- }
- public Customer(String firstName, String lastName, String email, String phoneNumber, Date birth) {
- this.firstName = firstName;
- this.lastName = lastName;
- this.email = email;
- this.phoneNumber = phoneNumber;
- this.birth = birth;
- }
- public int getId() {
- return id;
- }
- public void setId(int id) {
- this.id = id;
- }
- public String getFirstName() {
- return firstName;
- }
- public void setFirstName(String firstName) {
- this.firstName = firstName;
- }
- public String getLastName() {
- return lastName;
- }
- public void setLastName(String lastName) {
- this.lastName = lastName;
- }
- public String getEmail() {
- return email;
- }
- public void setEmail(String email) {
- this.email = email;
- }
- public String getPhoneNumber() {
- return phoneNumber;
- }
- public void setPhoneNumber(String phoneNumber) {
- this.phoneNumber = phoneNumber;
- }
- public Date getBirth() {
- return birth;
- }
- public void setBirth(Date birth) {
- this.birth = birth;
- }
- @Override
- public String toString() {
- return "Customer{" +
- "customerId=" + id +
- ", firstName='" + firstName + '\'' +
- ", lastName='" + lastName + '\'' +
- ", email='" + email + '\'' +
- ", phoneNumber='" + phoneNumber + '\'' +
- ", birth=" + birth +
- '}';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement