Skip to content

Instantly share code, notes, and snippets.

@xilin
Created March 18, 2015 03:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xilin/48f71113519b899781c4 to your computer and use it in GitHub Desktop.
Save xilin/48f71113519b899781c4 to your computer and use it in GitHub Desktop.
Hibernate Update
StringBuffer sql = new StringBuffer();
sql.append("UPDATE TABLE_NAME ");
sql.append("SET FIELD_NAME = FIELD_VALUE ");
sql.append("WHERE COND_FIELD =:param ");
SQLQuery query = this.getSession().createSQLQuery(sql.toString());
query.setParameter("param", paramValue);
query.executeUpdate();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment