package garbagetown.domain.model;

import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Created by garbagetown on 10/10/15.
 */
@Data
@NoArgsConstructor
@Entity
@Table(name = "customer")
public class Customer implements Serializable {

    @Id
    @NotNull
    @Size(min = 1, max = 8)
    @Column(name = "customer_code")
    private String customerCode;

    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "customer_name")
    private String customerName;

    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "customer_kana")
    private String customerKana;

    @NotNull
    @Size(min = 1, max = 64)
    @Column(name = "customer_pass")
    private String customerPass;

    @NotNull
    @Column(name = "customer_birth")
    private Date customerBirth;

    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "customer_job")
    private String customerJob;

    @NotNull
    @Size(min = 1, max = 300)
    @Column(name = "customer_mail")
    private String customerMail;

    @NotNull
    @Size(min = 1, max = 13)
    @Column(name = "customer_tel")
    private String customerTel;

    @NotNull
    @Size(min = 1, max = 8)
    @Column(name = "customer_post")
    private String customerPost;

    @NotNull
    @Size(min = 1, max = 300)
    @Column(name = "customer_add")
    private String customerAdd;

    @OneToMany(cascade = CascadeType.ALL, mappedBy = "customer")
    private List<Reserve> reserves;

    public Customer(String customerCode) {
        this.customerCode = customerCode;
    }
}

@@ -62,33 +62,90 @@
  lombok.
-NoArgsConstructor
+EqualsAndHashCode;%0Aimport lombok.NoArgsConstructor;%0Aimport lombok.ToString
 ;%0A%0Aimpor
@@ -383,16 +383,89 @@
 /%0A@Data%0A
+@ToString(exclude = %22reserves%22)%0A@EqualsAndHashCode(exclude = %22reserves%22)%0A
 @NoArgsC

exclude reserves from toString, equals and hashCode