}
final JdbcTransaction currentTransaction = TX.get();
if (null == currentTransaction) {
throw new RepositoryException("Invoking update() outside a transaction");
}
final JSONObject oldJsonObject = get(id);
final Connection connection = getConnection();
final List<Object> paramList = new ArrayList<Object>();
final StringBuilder sqlBuilder = new StringBuilder();
try {
update(id, oldJsonObject, jsonObject, paramList, sqlBuilder);
final String sql = sqlBuilder.toString();
if (Strings.isEmptyOrNull(sql)) {
return;
}
JdbcUtil.executeSql(sql, paramList, connection);
} catch (final SQLException se) {
LOGGER.log(Level.SEVERE, "update:"
+ se.getMessage(), se);
throw new JDBCRepositoryException(se);
} catch (final Exception e) {
LOGGER.log(Level.SEVERE, "update:"
+ e.getMessage(), e);
throw new RepositoryException(e);
}
}