title: JDBI3 reverse of AbstractArgumentFactory.build
body: <p>My MySQL table looks have three columns one long(user_id) another varchar(name) and finally varchar(rules(this is a JSON array as string)). I have integrated JDBI3 recently and I am using its <code>@BindBean</code> option. My bean(user class) looks as follows.</p>
  
  <pre><code>public class User {
      private long id;
      private String name;
      private List&lt;Rule&gt; rules;
  }
  </code></pre>
  
  <p>and my rule class looks as follow.</p>
  
  <pre><code>public class Rule {
      private long id;
  }
  </code></pre>
  
  <p>I have also created an <code>AbstractArgumentFactory</code> as follows</p>
  
  <pre><code>public class RuleArgumentFactory extends AbstractArgumentFactory&lt;List&lt;Rule&gt;&gt; {
  
      public RuleArgumentFactory() {
          super(Types.VARCHAR);
      }
  
      @Override
      protected Argument build(List&lt;Rule&gt; value, ConfigRegistry config) {
          return (position, statement, ctx) -&gt; statement.setString(position, valueToJson());
      }
  }
  </code></pre>
  
  <p>I have finally attached the <code>ArgumentFactory</code> to handle while performing DB queries. Now when I am doing an update or insert operation like as follows it works well.</p>
  
  <pre><code>this.jdbi.useHandle(handle -&gt; {
      handle.registerArgument(new RuleArgumentFactory());
      handle.createUpdate(UPDATE_QUERY)
          .bindBean(User)
          .execute();
  });
  </code></pre>
  
  <p>But the problem is when I perform a select query, </p>
  
  <pre><code>return this.jdbi.withHandle(handle -&gt; {
      handle.registerArgument(new RuleArgumentFactory());
      return handle.createQuery(SELECT_QUERY)
              .bind(param, paramValue)
              .mapToBean(User.class)
              .findFirst();
  });
  </code></pre>
  
  <p>I am unable to get the <code>User</code> Object because when JDBI tries to execute the build function. Arguments to the function gets mismatched as they become <code>(String, ConfigRegistry)</code> while it is accepting <code>(List&lt;Rule&gt;, ConfigRegistry)</code> finally throwing the error <code>argument type mismatch</code>. Is there a way where I can serialise the JSON to the <code>List&lt;Rule&gt;</code> object. Perhaps something opposite to <code>build()</code>.  </p>