Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jjordansd/001cf9672fa7f619f023 to your computer and use it in GitHub Desktop.

Select an option

Save jjordansd/001cf9672fa7f619f023 to your computer and use it in GitHub Desktop.

Revisions

  1. @langmi langmi created this gist Sep 30, 2011.
    18 changes: 18 additions & 0 deletions FieldSetSqlParameterSourceProvider.java
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    /**
    * Implementation for {@link ItemSqlParameterSourceProvider},
    * creates {@link MapSqlParameterSource} from {@link FieldSet}.
    *
    * @author Michael R. Lange <[email protected]>
    */
    public class FieldSetSqlParameterSourceProvider implements ItemSqlParameterSourceProvider<FieldSet> {

    /** {@inheritDoc} */
    @Override
    public SqlParameterSource createSqlParameterSource(FieldSet item) {
    MapSqlParameterSource sps = new MapSqlParameterSource();
    for (Entry<Object, Object> entry : item.getProperties().entrySet()) {
    sps.addValue(entry.getKey().toString(), entry.getValue());
    }
    return sps;
    }
    }