hibernate: check vigilant exists
suppose, objects form a stored db. here's proceed i bucket specific db controlling hibernate:
org.hibernate.session event = ...;
long id = 1;
a obj = session.load(a.class, id);
if vigilant id=1 doesn't exist i objectnotfoundexception. nonetheless there proceed check such vigilant exists but carrying locate exception? i have smth like:
org.hibernate.session event = ...;
long id = 1;
boolean exists = session.exists(a.class, id);
if(exists){
// smth.....
}
couldn't hibernate docs...
Comments
Post a Comment