有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Hibernate条件按最后一个id连接顺序

我需要一个货币列表,其中只包含货币历史记录的最后一个值,在sql中,此查询有效:

    select
      this_.name as y2_,
      this_.id as y3_,
      this_.currency as y4_,
      (select currency_value from currency_history where currency_id = this_.id order by id desc limit 1) as y5_,
      (select date_register from currency_history where currency_id = this_.id order by id desc limit 1) as y6_
  from
      currency this_ 

如何在Hibernate标准中实现这一点


共 (0) 个答案