@Entity
@Table(name = "USERS")
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private long id;
@Column(name = "USERNAME", nullable = false, length = 20)
private String userName;
@Column(name = "PASSWORD", nullable = false, length = 10)
private String password;
@Column(name = "Date", nullable = false )
private Date date;
}
如何选择日期之间的记录
- [现在| 现在-x小时]
- [现在| 现在-x天]
- [现在| 现在-x个月]
- [现在| 现在-x年]