次のクエリがあります。
List results = getSession()
.createCriteria(AppointmentSlot.class)
.setProjection(
Projections.projectionList()
.add(Projections.min("startTime"))
.add(Projections.max("endTime"))
.add(Projections.groupProperty("clinicInfo"))
.add(Projections.groupProperty("staffInfo"))
.add(Projections.groupProperty("status"))
.add(Projections.groupProperty("dayId")))
.list();
min("startTime")
との差を計算する追加のプロパティを選択したいと思いますmax("endTime")
。
アップデート
startTime
列と列の両方のデータベースのサンプル値endTime
- 08:00:00、08:15:00
- 08:15:00、09:00:00
- 09:00:00、09:15:00 ...
Hibernateを使用してこれをどのように可能にしますか?