database - Hibernate Insert Query in Java -


can tell me how perform insert query hibernate , end postgresql using following implementation not working

session session = gileadhibernateutil.getsessionfactory().opensession(); session.begintransaction();  user a= new user(); a.setid(67); a.setfirstname("noor"); a.setlastname("asd"); a.setmobilenumber("2435"); a.settelephonenumber("dfg");  session.save(a); session.gettransaction().commit(); 

as matt ball suggested, try using entitymanager.persist(java.lang.object entity) (see here) instead. or try using persist without entitymanager (see discussion).


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -