GWT RPC, Spring, JPA/Hibernate - null on callback method -
this first app. have problem between gwt (rpc) , db (mysql). junit tests run great. here code: https://github.com/sutakjakub/game
client package:
userservice.util.getinstance().adduser("kuba","tajne", new asynccallback<long>() { @override public void onfailure(throwable arg0) { window.alert("get se nezdaril" + arg0); } @override public void onsuccess(long id) { if(id == null){ window.alert("null"); }else{ window.alert("zapsano db; id=" + id); } } }); this method must return id of new user return null (in method onsuccess(long id)).
i dont have error logs. tried everything. thank idea or solution.
an updated entity isn't returned saveorupdate method (generichibernatejpadao):
@override public <entity extends abstractbussinessobject> entity saveorupdate(entity o) { if(o.getid() == null){ getentitymanager().persist(o); }else{ getentitymanager().merge(o); } return o; } should become:
return getentitymanager().merge(o); if want use persist(), should read this well.
Comments
Post a Comment