I have a simple code snippet provided below along with the necessary hibernate configuration. The issue is all the 'insert' statements are being printed but 'select' statements are not printed.
Session sess = session.openSession();
Transaction tx = sess.beginTransaction();
Address addr = new Address();
addr.setStreet("street");
Employee pojo = new Employee();
pojo.setName("XYZ");
pojo.setAddress(addr);
System.out.println("ID " + pojo.getId());
sess.saveOrUpdate(pojo);
tx.commit();
session.close()
The above code prints 'insert' statements in standard output
Session sess = session.openSession();
Transaction tx = sess.beginTransaction();
Employee pojo = (Employee) sess.get(Employee.class, 1);
System.out.println(pojo.getName());
System.out.println(pojo.getAddress().getStreet());
tx.commit();
session.close();
The above code does not print the 'select' statement. I have tried using load() instead of get(), but the result is the same.
This configuration is available in hibernate configuration.
<property name="show_sql">true</property>
Thanks in advance.