the Cat persistent object has two fileds: catId and name,when using name as the search condition ,it return the results,but when using the catId ,it return the error:
net.sf.hibernate.QueryException: Number of positional parameter types (0 does not match number of positional parameters (1)
at net.sf.hibernate.engine.QueryParameters.validateParameters(QueryParameters.java:134)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1530)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1520)
why?
|