As i can see only list method in query class in hibernate.How to get set or array directly from query in hibernate?
Query q = session.createQuery("from com.daasl.Person");
List<Person> l = q.list();
Is there a way i can get set or array directly instead of list?
Querycan only return a list .But you can convert the generic list to the generic array using the toArray(T[] a) of the java standard Collection interface
To convert the list to a set , just supply the list to the constructor of the HashSet