I have a DAO java class. In the DAO, I execute a native SQL Query which outputs two records from the database. The results is printed on the console. However, when the method is called, only one record is returned. Why?
DAO Java Class:
public Showroom SearchShowroom(String carMake){
Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction();
SQLQuery query = session.createSQLQuery("SELECT * from showroom);
tx.commit();
session.close();
return sw;
}