java - Parameter does not exist as a named parameter -
my query this:
query query1 = session.createquery("select c.email contact c c.contactno =:contactno"); query1.setinteger("contactno", 22); the error got is:
exception in thread "main" java.lang.illegalargumentexception: parameter contactno not exist named parameter in [select c.email contact c c.contactno = ?]
it working fine
query query = session.createquery("select c.email contact c c.contactno = ?"); query.setinteger(0, 22); why 1st query not working?
query query1 = session.createquery("select c.email contact c c.contactno =:contactno"); query.setparameter("contactno", 22);
try using setparameter instead of setinteger
java hibernate
No comments:
Post a Comment