I am new to Hibernate, I want to get table values ββfrom a database, I have code, but it returns the values ββof the object. My sample code is
Configuration conf=new Configuration(); @SuppressWarnings("deprecation") SessionFactory sessionfactory=conf.configure().buildSessionFactory(); Session session=sessionfactory.openSession(); List maintable = null; try { org.hibernate.Transaction tx = session.beginTransaction(); Query q = session.createQuery ("select main.empid,main.address from Main as main"); maintable =q.list(); Object[] obj=maintable.toArray(); for(int i=0;i<obj.length;i++) { System.out.println("column valuse : "+obj[i]); } tx.commit(); session.close(); } catch(Exception e1) { System.out.println("Exception"); }
I need to get some column values ββ... How can I do this?
source share