hibernate - Session.save(obj) retrun zero -


i new hibernate.i creating table using hibernate. can see result in db. session.save(obj) still return 0 although should return 1 guess. code:

public static int register(user u) {      int = 0;       session session = new annotationconfiguration().configure().buildsessionfactory().opensession();     try {          transaction t = session.begintransaction();         // t.begin();            = (integer) session.save(u);           system.out.println("value of is::"+(integer)session.save(u));         system.out.println(session.save(u).getclass().getname());         t.commit();           session.close();     }     catch(runtimeexception e) {         session.gettransaction().rollback();         throw e;     }     return i;   } 

i using jsp , creating form , passing data. can me this?


Comments

Popular posts from this blog

PHP and MySQL WP -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

go - golang pprof for c library code -