package cl.fatman.capital.fund;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import java.time.LocalDate;

@Entity
@Table(name = "foment_unit")
public class FomentUnit {
	
	@Id
	@GeneratedValue(generator = "increment")
	@GenericGenerator(name = "increment", strategy = "increment")
	private int id;
	private double value;
	@Column(unique = true)
	private LocalDate date;
	
	public FomentUnit() {
		super();
	}
	
	public FomentUnit(double value, LocalDate date) {
		super();
		this.value = value;
		this.date = date;
	}
	
	public int getId() {
		return id;
	}
	
	public void setId(int id) {
		this.id = id;
	}
	
	public double getValue() {
		return value;
	}
	
	public void setValue(double value) {
		this.value = value;
	}
	
	public LocalDate getDate() {
		return date;
	}
	
	public void setDate(LocalDate date) {
		this.date = date;
	}
}
@@ -96,49 +96,8 @@
 ty;%0A
-import javax.persistence.GeneratedValue;%0A
 impo
@@ -158,60 +158,8 @@
 e;%0A%0A
-import org.hibernate.annotations.GenericGenerator;%0A%0A
 impo
@@ -258,124 +258,22 @@
 Id%0A%09
-@GeneratedValue(generator = %22increment%22)%0A%09@GenericGenerator(name = %22increment%22, strategy = %22increment%22)%0A%09private int
+private String
  id;
@@ -448,16 +448,45 @@
 uper();%0A
+%09%09this.id = date.toString();%0A
 %09%09this.v
@@ -532,19 +532,22 @@
 %09public 
+Str
 in
-t
+g
  getId()
@@ -590,11 +590,14 @@
 tId(
+Str
 in
-t
+g
  id)

Change id to String type to avoid data duplication.