我该如何获取一天和一小时的吸气剂-像这样-day +“。” + hour并使其成为数据库的主键? 它必须是字符串。私有字符串键=天+“。 +小时; 需要什么类型的注释? 谢谢!
我尝试了一些事情,但是
file.Content
@Table(name =“ Tasks_Details”) 公共类JPAMap {
@Embeddable
public class Task {
@Column(name = "description")
private String description = null;
@Column(name = "day")
private int day = 0;
@Column(name = "hour")
private int hour = 0;
public Task() {
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public Integer getDay() {
return day;
}
public void setDay(Integer day) {
this.day = day;
}
public Integer getHour() {
return hour;
}
public void setHour(Integer hour) {
this.hour = hour;
}
@Entity
}