Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个名为 PriceChange 的表。它具有以下列:Sno、Time、Price、ShareID。
我想选择具有最低 Sno 值的给定 shareID 的价格。如何使用 Hibernate 实现这一目标?
那这个呢?
Query q = session. createQuery("SELECT Price FROM PriceChange WHERE ShareID = ? ORDER BY Sno"); q.setFirstResult(1); q.setMaxResults(1);