只想使用hibernate在数据库中插入时间部分....
我正在尝试的是......
public static void main(String[] args)
{
Calendar cal = Calendar.getInstance();
UserID ui = new UserID();
CompKeyClass ckc1=new CompKeyClass();
ckc1.setAge(21);
ckc1.setUserID(ui);
ui.setDeptno("1002");
ckc1.setCal1(cal.getTime());
......
@Id
private UserID userID;
@SequenceGenerator(name="myseqgen",sequenceName="employeehib")
@GeneratedValue(generator="myseqgen")
private char man='a';
@Temporal(TemporalType.TIMESTAMP)
private Date hireDate;
@Temporal(TemporalType.TIME)
private Date timedate;
@Temporal(TemporalType.DATE)
private Date datedate;
@Temporal(TemporalType.DATE)
private Date cal1;
@Temporal(TemporalType.TIME)
但是在这里,当我调用 getTime 方法时,它会显示日期。
有什么办法只显示时间部分....