package task.timer.model;
import java.sql.Date;
import java.util.Set;

import javax.persistence.*;

import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;

// TODO: Add Task connection

@Entity
@Table(name="RECORDS")

public class Record extends AbstractEntity {
	
	 private int id;
	 private User user;	
	 private Project project;
	 private Date timeStart;
	 private Date timeStop;
	 
	public Record(User user, Project project, Date timeStart, Date timeStop) {
		this.user = user;
		this.project = project;
		this.timeStart = timeStart;
		this.timeStop = timeStop;
	}
	
	public Record(){
	
	}

	@Id @GeneratedValue
	@Column(name = "id")
	public int getId() {
		return id;
	}
	
	@ManyToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="user")
	public User getUser() {
		return user;
	}
	
	@ManyToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="project")
	public Project getProject() {
		return project;
	}

	@Column(name="timeStart")
	public Date getTimeStart() {
		return timeStart;
	}

	@Column(name="timeStop")
	public Date getTimeStop() {
		return timeStop;
	}

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

	public void setUser(User user) {
		this.user = user;
	}

	public void setProject(Project project) {
		this.project = project;
	}

	public void setTimeStart(Date timeStart) {
		this.timeStart = timeStart;
	}

	public void setTimeStop(Date timeStop) {
		this.timeStop = timeStop;
	}
	 
}

package task.timer.model;
import java.sql.Date;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.Set;

import javax.persistence.*;

import javafx.beans.property.IntegerProperty;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;

// TODO: Add Task connection

@Entity
@Table(name="RECORDS")

public class Record extends AbstractEntity {
	 
	public Record(User user, Project project, LocalDate date, LocalTime timeStart, LocalTime timeStop) {
		this.user = user;
		this.project = project;
		this.date = date;
		this.timeStart = timeStart;
		this.timeStop = timeStop;
	}
	
	public Record(){
	
	}

	@Id @GeneratedValue
	@Column(name = "id")
	private int id;

	
	@ManyToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="user")
	private User user;	

	@ManyToOne(cascade=CascadeType.ALL)
	@JoinColumn(name="project")
	private Project project;

	@Column(name="date")
	private LocalDate date;

	@Column(name="timeStart")
	private LocalTime timeStart;

	@Column(name="timeStop")
	private LocalTime timeStop;

	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}
	
	public IntegerProperty getIdProperty(){
		SimpleIntegerProperty idProperty = new SimpleIntegerProperty(id);
		return idProperty;
	}

	public User getUser() {
		return user;
	}
	
	public void setUser(User user) {
		this.user = user;
	}
	
	public StringProperty getUserName(){
		SimpleStringProperty userNameProperty = new SimpleStringProperty(user.getFirstName() + " " + user.getLastName());
		return userNameProperty;
	}
	
	public Project getProject() {
		return project;
	}

	public void setProject(Project project) {
		this.project = project;
	}
	
	public StringProperty getProjectName(){
		SimpleStringProperty projectNameProperty = new SimpleStringProperty(project.getName());
		return projectNameProperty;
	}

	public LocalTime getTimeStart() {
		return timeStart;
	}
	
	public void setTimeStart(LocalTime timeStart) {
		this.timeStart = timeStart;
	}
	
	public StringProperty getTimeStartProperty(){
		SimpleStringProperty timeStartProperty = new SimpleStringProperty(timeStart.toString());
		return timeStartProperty;
	}
	
	public LocalTime getTimeStop() {
		return timeStop;
	}

	public void setTimeStop(LocalTime timeStop) {
		this.timeStop = timeStop;
	}
	
	public StringProperty getTimeStopProperty(){
		SimpleStringProperty timeStopProperty = new SimpleStringProperty(timeStop.toString());
		return timeStopProperty;
	}
	
	public LocalDate getDate() {
		return date;
	}

	public void setTimeStop(LocalDate date) {
		this.date = date;
	}
	
	public StringProperty getDateProperty(){
		SimpleStringProperty dateProperty = new SimpleStringProperty(date.toString());
		return dateProperty;
	}
	 
}

change and add fields about time and date