mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
files hosted elsewhere
These files have been relocated elsewhere
This commit is contained in:
-77
@@ -1,77 +0,0 @@
|
||||
package com.sqlsamples;
|
||||
|
||||
import java.util.Date;
|
||||
import javax.persistence.*;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
@Entity
|
||||
@Table(name = "Tasks")
|
||||
public class Task {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.AUTO)
|
||||
@Column(name = "id", updatable = false, nullable = false)
|
||||
private Long id;
|
||||
private String title;
|
||||
private Boolean isComplete;
|
||||
@Temporal(TemporalType.TIMESTAMP)
|
||||
private Date dueDate;
|
||||
|
||||
// Specify a Many:1 mapping between Task and User
|
||||
@ManyToOne
|
||||
private User user;
|
||||
|
||||
public Task() {
|
||||
}
|
||||
|
||||
public Task(String title, Date dueDate) {
|
||||
this.title = title;
|
||||
this.dueDate = dueDate;
|
||||
this.isComplete = false;
|
||||
}
|
||||
|
||||
public Task(String title, Date dueDate, User user) {
|
||||
this.title = title;
|
||||
this.dueDate = dueDate;
|
||||
this.isComplete = false;
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return this.title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public User getUser() {
|
||||
return this.user;
|
||||
}
|
||||
|
||||
public void setUser(User user) {
|
||||
this.user = user;
|
||||
}
|
||||
|
||||
public Date getDueDate() {
|
||||
return this.dueDate;
|
||||
}
|
||||
|
||||
public void setDueDate(Date dueDate) {
|
||||
this.dueDate = dueDate;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
SimpleDateFormat ft = new SimpleDateFormat("E yyyy.MM.dd 'at' hh:mm:ss a zzz");
|
||||
return "Task [id=" + this.id + ", title=" + this.title + ", dueDate=" + ft.format(this.dueDate)
|
||||
+ ", isComplete=" + this.isComplete.toString() + "]";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user