【问题标题】:Order by JPQL NoobJPQL Noob 订购
【发布时间】:2018-08-13 08:48:53
【问题描述】:

我试图让我的查询按我的时间戳列排序,但我不知道出了什么问题?

String sql = super._jpaql + "where entity.unit.ua=:ua order by timestamp desc";
Query query = super._entityManager.createQuery(sql).setParameter("ua", ua);

List<UnitNotesEntity> list = (List<UnitNotesEntity>) query.getResultList();

【问题讨论】:

    标签: java sql jpql


    【解决方案1】:

    应该是:

    where entity.unit.ua=:ua order by entity.timestamp desc
    

    【讨论】:

      猜你喜欢
      • 2011-08-19
      • 2011-08-03
      • 2016-10-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-01-26
      • 2020-09-08
      • 2017-09-14
      相关资源
      最近更新 更多