misleading exception when the entity it not mapped

Description

When the entity in not mapped, and I write a code like this:

final Query query = session.createQuery(hql);
if (values != null && values.length > 0) {
for (int i = 0; i < values.length; i++) {
query.setParameter(i, values[i]/, types[i]/);
}
}

I get an exception java.lang.IndexOutOfBoundsException: Remember that ordinal parameters are 1-based!

While the real problem is that the entity was not mapped in hibernate.cfg.xml file!

Please fix the error message

Environment

None

Activity

Show:
Brett Meyer
October 2, 2013, 2:23 PM

Rejecting, as the out of bounds could probably be caused by any number of issues...

Rejected

Assignee

Unassigned

Reporter

odelya holiday

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure