public List<String> createSql(DbEntity entity, DbAttribute column) { SQLParameterBinding value = get(entity, column); if (value == null) { return Collections.emptyList(); } // TODO: change things so it is possible to use prepared statements here return Collections.singletonList( "UPDATE " + entity.getFullyQualifiedName() + " SET " + column.getName() + "='" + value.getValue() + "' WHERE " + column.getName() + " IS NULL"); }
@Override protected void render(InternalContextAdapter context, Writer writer, SQLParameterBinding binding) throws IOException { if (binding.getValue() != null) { bind(context, binding); writer.write("<> ?"); } else { writer.write("IS NOT NULL"); } }