HQL substring last x characters
问题 I am quite new to Hibernate, and I would like to get the last N characters of a string. I found the substring method, but that didn't really help :( Does anyone have any idea? TIA 回答1: I actually fixed it using substring. I forgot that I can use parameters. I did something like: Query q = " .. where substring (field, :offset, :length) = something_else" q.setParameter("offset", field.length() - N + 1); q.setParameter("length", N); 回答2: I am surprised this didn't help substring(int beginIndex,