我如何从表中获取数据

时间:2011-12-19 18:56:49

标签: java hibernate jpa

我有豆作为:

public class ReminderHeader implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    @Basic(fetch = FetchType.EAGER)
    private long id;

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "FromDateTime", nullable = false)
    private Date fromDateTime;
}

我想在fromDateTime =特定日期

时选择所有内容

我用:

Criteria c = getCurrentSession().createCriteria(ReminderHeader.class);
c.add(Restrictions.eq("fromDateTime", new Date())).list();

并给我例外 我如何从日期表中选择数据?

0 个答案:

没有答案