package com.squad.model;


import javax.persistence.*;
import java.util.List;

@Entity
@Table(name = "offers")
public class Offer implements java.io.Serializable {
    @Column(name = "type")

    private String type;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "idFeatures", nullable = false)
    private Feature feature;

    @ManyToOne(fetch = FetchType.EAGER)
    @JoinColumn(name = "idAddresses", nullable = false)
    private Address address;

    @OneToMany(cascade = CascadeType.ALL, mappedBy = "offer", fetch = FetchType.EAGER)
    List<Image> images;


    @Column(name = "price")
    private String price;

    @Column(name = "emailUser")
    private String emailUser;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "id")
    private int id;

    @Column(name = "details", length = 255)
    private String details;

    public Offer(String type, Feature feature, Address address, List<Image> images, String price, String emailUser, int id, String details) {
        this.type = type;
        this.feature = feature;
        this.address = address;
        this.images = images;
        this.price = price;
        this.emailUser = emailUser;
        this.id = id;
        this.details = details;
    }

    public Offer() {
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Feature getFeature() {
        return feature;
    }

    public void setFeature(Feature feature) {
        this.feature = feature;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    public List<Image> getImages() {
        return images;
    }

    public void setImages(List<Image> images) {
        this.images = images;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getEmailUser() {
        return emailUser;
    }

    public void setEmailUser(String emailUser) {
        this.emailUser = emailUser;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getDetails() {
        return details;
    }

    public void setDetails(String details) {
        this.details = details;
    }
}

@@ -19,17 +19,16 @@
 model;%0A%0A
-%0A
 import j
@@ -46,16 +46,167 @@
 tence.*;
+%0A%0Aimport org.springframework.format.annotation.DateTimeFormat;%0Aimport org.springframework.format.annotation.DateTimeFormat.ISO;%0A%0Aimport java.util.Date;
 %0Aimport 
@@ -307,16 +307,17 @@
 zable %7B%0A
+%0A
     @Col
@@ -335,17 +335,16 @@
 %22type%22)%0A
-%0A
     priv
@@ -724,17 +724,16 @@
 mages;%0A%0A
-%0A
     @Col
@@ -851,61 +851,201 @@
    @
-Id%0A    @GeneratedValue(strategy = Generation
+DateTimeFormat(iso = ISO.NONE)%0A    @Temporal(TemporalType.DATE)%0A    @Column(name = %22date_added%22)%0A    private Date dateAdded;%0A%0A    @DateTimeFormat(iso = ISO.NONE)%0A    @Temporal(Temporal
 Type.
-AUTO
+DATE
 )%0A  
@@ -1062,17 +1062,27 @@
 name = %22
-i
+date_delete
 d%22)%0A    
@@ -1089,21 +1089,31 @@
 private 
-int i
+Date dateDelete
 d;%0A%0A    
@@ -1134,17 +1134,16 @@
  %22detail
-s
 %22, lengt
@@ -1176,24 +1176,130 @@
 g details;%0A%0A
+    @Id%0A    @GeneratedValue(strategy = GenerationType.AUTO)%0A    @Column(name = %22id%22)%0A    private int id;%0A%0A
     public O
@@ -1402,21 +1402,47 @@
 ilUser, 
-int i
+Date dateAdded, Date dateDelete
 d, Strin
@@ -1442,32 +1442,40 @@
 , String details
+, int id
 ) %7B%0A        this
@@ -1655,30 +1655,84 @@
        this.
-id = i
+dateAdded = dateAdded;%0A        this.dateDeleted = dateDelete
 d;%0A        t
@@ -1746,32 +1746,54 @@
 ails = details;%0A
+        this.id = id;%0A
     %7D%0A%0A    publi
@@ -2704,16 +2704,24 @@
 lic 
-int getI
+Date getDateAdde
 d() 
@@ -2737,17 +2737,24 @@
  return 
-i
+dateAdde
 d;%0A    %7D
@@ -2778,40 +2778,237 @@
  set
-Id(int id) %7B%0A        this.id = i
+DateAdded(Date dateAdded) %7B%0A        this.dateAdded = dateAdded;%0A    %7D%0A%0A    public Date getDateDeleted() %7B%0A        return dateDeleted;%0A    %7D%0A%0A    public void setDateDeleted(Date dateDeleted) %7B%0A        this.dateDeleted = dateDelete
 d;%0A 
@@ -3159,11 +3159,123 @@
 s;%0A    %7D
+%0A%0A    public int getId() %7B%0A        return id;%0A    %7D%0A%0A    public void setId(int id) %7B%0A        this.id = id;%0A    %7D
 %0A%7D%0A

Fix offer