不显示从数据库中获取所需的列表

时间:2018-10-22 09:21:44

标签: java spring spring-boot

上传csv文件后,我无法从数据库中获取数据。我在mysql中导入了csv文件。我没有按照

的要求得到期望的输出
IDs, Datetime
1,14/11/06 11:58:40
1,14/11/07 09:57:44
1,14/11/07 19:42:15
1,14/11/10 10:04:49
1,14/11/10 19:38:05
1,14/11/11 09:59:37
1,14/11/11 13:37:01

输出显示:

1   2014-11-06 11:58:40.0
1   2014-11-06 11:58:40.0
1   2014-11-06 11:58:40.0
1   2014-11-06 11:58:40.0
1   2014-11-06 11:58:40.0
1   2014-11-06 11:58:40.0
1   2014-11-06 11:58:40.0
1   2014-11-06 11:58:40.0

我的方法:

@Override
public List<Uploaded> getUploaded() {
    Session currentSession = session.getCurrentSession();
    Transaction trans=currentSession.beginTransaction();
    Query theQuery = currentSession.createQuery("select s from Uploaded s");
    List<Uploaded> uploaded = theQuery.list();
    trans.commit();
    return uploaded;
}

0 个答案:

没有答案