Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

hibernate query list: empty or null?

If I have method which use Hibernate, like this:

public <T> T typedQuery(Query q, Class<T> type) {
    List<T> results = q.list();

    //result will be null or empty List ?
}

If query won't get any record from table, result will be null or empty List?

like image 262
kuba44 Avatar asked Nov 10 '14 15:11

kuba44


1 Answers

It will return an empty list, if there are no results. Relevant post

like image 83
Predrag Maric Avatar answered Nov 16 '22 15:11

Predrag Maric