 <p>I'll copy paste my answer from <a href="http://stackoverflow.com/a/25552002/3987202">http://stackoverflow.com/a/25552002/3987202</a><br><br> Another solution for those of us who can't make the jump to Hibernate 4.1.3.<br> Simply use <code>/*'*/:=/*'*/</code> inside the query. Hibernate code treats everything between <code>'</code> as a string (ignores it). MySQL on the other hand will ignore everything inside a blockquote and will evaluate the whole expression to an assignement operator.<br> I know it's quick and dirty, but it get's the job done without stored procedures, interceptors etc.</p>