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

Popular posts from this blog

list macos calm editors formula editors

how hibernate @any-related annotations?

why does floated <input> control floated component slip over too distant right ie7, nonetheless firefox?