java - Hibernate Exception - could not locate named parameter [:laboratoryId] -
i have following query in hibernate.i got hibernate exception , don't understand why hibernate throws exception. me?
session session = this.sessionfactory.opensession(); session.createquery("delete laboratory l l.id=:laboratoryid") .setparameter("laboratoryid", laboratoryid).executeupdate(); session.close();
try add spaces between =
sign , bind name :laboratoryid
, remove alias:
session session = this.sessionfactory.opensession(); session.createquery("delete laboratory id = :laboratoryid") .setparameter("laboratoryid", laboratoryid) .executeupdate(); session.close();
Comments
Post a Comment