15

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?

Yassin Hajaj
  • 21,337
  • 9
  • 51
  • 89
kuba44
  • 1,838
  • 9
  • 34
  • 62

1 Answers1

22

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

Community
  • 1
  • 1
Predrag Maric
  • 23,938
  • 5
  • 52
  • 68