16

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?

1 Answer 1

23

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.