add another test for @HQL method return types

This commit is contained in:
Gavin King 2023-09-05 20:03:37 +02:00
parent 4e1f4aeeb7
commit 5737235bf9
2 changed files with 12 additions and 0 deletions

View File

@ -10,4 +10,5 @@ public class Book {
@NaturalId String title;
@NaturalId String author;
String text;
int pages;
}

View File

@ -9,6 +9,8 @@ import org.hibernate.query.Order;
import org.hibernate.query.Page;
import org.hibernate.query.SelectionQuery;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;
public interface Dao {
@ -98,4 +100,13 @@ public interface Dao {
@Find
List<Book> sortedBooks(String isbn, Order<? super Book>... order);
@HQL("select local date")
LocalDate localDate();
@HQL("select local datetime")
LocalDateTime localDatetime();
@HQL("select avg(pages) from Book")
double averagePageCount();
}