{"action":"created","comment":{"url":"https://api.github.com/repos/jdbi/jdbi/pulls/comments/48639273","id":48639273,"diff_hunk":"@@ -242,30 +244,32 @@ public boolean isInTransaction()\n     @Override\n     public Update createStatement(String sql)\n     {\n+        Foreman updateForeman = foreman.createChild();\n         return new Update(this,\n                           statementLocator,\n                           statementRewriter,\n                           statementBuilder,\n                           sql,\n-                          new ConcreteStatementContext(globalStatementAttributes, MappingRegistry.copyOf(mappingRegistry)),\n+                          new ConcreteStatementContext(globalStatementAttributes, MappingRegistry.copyOf(mappingRegistry), updateForeman),\n                           timingCollector,\n-                          foreman,\n+                          updateForeman,\n                           collectorFactoryRegistry);","path":"core/src/main/java/org/jdbi/v3/BasicHandle.java","position":50,"original_position":50,"commit_id":"9500416eae32c6f23659cdab70de653a7a1aa900","original_commit_id":"9500416eae32c6f23659cdab70de653a7a1aa900","user":{"login":"stevenschlansker","id":129097,"avatar_url":"https://avatars.githubusercontent.com/u/129097?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenschlansker","html_url":"https://github.com/stevenschlansker","followers_url":"https://api.github.com/users/stevenschlansker/followers","following_url":"https://api.github.com/users/stevenschlansker/following{/other_user}","gists_url":"https://api.github.com/users/stevenschlansker/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenschlansker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenschlansker/subscriptions","organizations_url":"https://api.github.com/users/stevenschlansker/orgs","repos_url":"https://api.github.com/users/stevenschlansker/repos","events_url":"https://api.github.com/users/stevenschlansker/events{/privacy}","received_events_url":"https://api.github.com/users/stevenschlansker/received_events","type":"User","site_admin":false},"body":"I think so, otherwise registering on the `Update` will cascade up to the `Handle`.","created_at":"2015-12-30T23:29:30Z","updated_at":"2015-12-30T23:29:30Z","html_url":"https://github.com/jdbi/jdbi/pull/235#discussion_r48639273","pull_request_url":"https://api.github.com/repos/jdbi/jdbi/pulls/235","_links":{"self":{"href":"https://api.github.com/repos/jdbi/jdbi/pulls/comments/48639273"},"html":{"href":"https://github.com/jdbi/jdbi/pull/235#discussion_r48639273"},"pull_request":{"href":"https://api.github.com/repos/jdbi/jdbi/pulls/235"}}},"pull_request":{"url":"https://api.github.com/repos/jdbi/jdbi/pulls/235","id":51326661,"html_url":"https://github.com/jdbi/jdbi/pull/235","diff_url":"https://github.com/jdbi/jdbi/pull/235.diff","patch_url":"https://github.com/jdbi/jdbi/pull/235.patch","issue_url":"https://api.github.com/repos/jdbi/jdbi/issues/235","number":235,"state":"open","locked":false,"title":"Use java.lang.reflect.Type instead of Class<?> in factories","user":{"login":"qualidafial","id":38629,"avatar_url":"https://avatars.githubusercontent.com/u/38629?v=3","gravatar_id":"","url":"https://api.github.com/users/qualidafial","html_url":"https://github.com/qualidafial","followers_url":"https://api.github.com/users/qualidafial/followers","following_url":"https://api.github.com/users/qualidafial/following{/other_user}","gists_url":"https://api.github.com/users/qualidafial/gists{/gist_id}","starred_url":"https://api.github.com/users/qualidafial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qualidafial/subscriptions","organizations_url":"https://api.github.com/users/qualidafial/orgs","repos_url":"https://api.github.com/users/qualidafial/repos","events_url":"https://api.github.com/users/qualidafial/events{/privacy}","received_events_url":"https://api.github.com/users/qualidafial/received_events","type":"User","site_admin":false},"body":"## To do\r\n\r\n* [x] Move ArgumentFactory to TypeToken\r\n* [x] Ditto ResultColumnMapperFactory\r\n* [x] Ditto ResultSetMapperFactory\r\n* [x] Ditto CollectorFactory\r\n  * [x] Change ResultBearing.collectInto(Class<T>) to TypeToken<T>?\r\n* [x] Keep all the method that take Class<T>, and add a sister method that accepts TypeToken<T>\r\n  * [x] SQLStatement.dynamicBind\r\n* [x] Expose argument factory registry (Foreman) through statement context.\r\n* [x] Enhance existing BinderFactory implementations to take advanced of generic type information.\r\n* [x] Implement OptionalArgument\r\n* [x] Confirm ResultReturnThing is getting full generic type information\r\n* [x] Use Classmate GenericType<T> instead of Guava TypeToken<T>\r\n\r\n## Questions\r\n\r\n* Change SQLObject from Class<T> to TypeToken<T>? Implies inspecting a possibly generified DAO class and producing methods depending on the nested parameters in the type token.\r\n  * Handle.attach\r\n  * DBI.open\r\n  * DBI.onDemand\r\n  * SqlObjectBuilderBridge methods\r\n  * StatementContext.sqlObjectType property\r\n  * SqlStatementCustomer methods\r\n  * CustomizingStatementHandler ctor parameter\r\n  * CreateSqlObjectHandler\r\n  * SqlObject methods\r\n  * SqlObjectBuilder methods\r\n  * SqlStatementCustomizingFactory methods\r\n  * StringTemplate3StatementLocator?\r\n\r\n* Built in row mappers use TypeToken instead of Class? Implies inspecting a possibly generified bean class and projecting that type onto generic members.\r\n  * BeanMapper\r\n    * BindBean can't do the converse--all we have is the instance class with generics erased.\r\n  * FieldMapper\r\n  * JpaMapper\r\n  * Query.mapToBean(TypeToken<T>)\r\n\r\n* Nothing we're doing here can be ported to existing annotations with methods that return Class types.\r\n\r\n## Unrelated todos discovered while working on this--not until after this PR\r\n\r\n* Rename registry methods `xyzFor` to `findXyzFor` and return an `Optional`\r\n* StatementContext.columnMapperFor renamed to findColumnMapperFor, returns Optional\r\n* Collapse factory `accepts` and `build` methods into a single `provide` (or otherwise named) method that returns an `Optional`.\r\n* Remove generic type parameter from `ArgumentFactory`?\r\n* [x] Remove generic type parameter from `CollectorFactory`?\r\n* Remove ResultBearing.collectInto(Class)--it's broken\r\n  * We could possibly do collectInto(TypeToken<T>), but CollectorFactory would have to be verify the element type agrees with the collector result type.\r\n* [x] BuiltInArgumentFactory enum encoding should use `Enum::name`\r\n* Rename built in column mappers to exclude `Column` from name--it's redundant\r\n* Do we need all those SQLStatement.bind(int|String, SpecificType) methods? Seems like a design smell to have these for every built in type, but users are on their own for custom types? \r\n* Eradicate `foo != null ? foo.something() : somethingElse`\r\n* Likewise for `if (!x) { foo(); } else { bar(); }`\r\n* `dynamicBind` should just overload `bind` and put the argument type last, effectively as an optional parameter\r\n* Should we get rid of ObjectArgument? SQLStatement.bind(int|String, Object)? Or maybe require users to call overloaded method with type parameter if the argument might be null\r\n  * If so, should also get rid of Foreman.waffle fallback to argument of type Object. An argument factory should be provided.\r\n* SqlObjectBuilderBridge: Should this be a ServiceLoader SPI instead of using reflection?\r\n* SqlStatementCustomizingAnnotation should be annotated `@Target(ElementType.ANNOTATION_TYPE)`\r\n* `@MapResultAsBean` is equivalent to `@RegisterMapperFactory(BeanMapperFactory.class)`. Do we need both?\r\n* `@Mapper` should be a SqlStatementCustomizingAnnotation instead of magic.\r\n* Should EnumColumnMapper be exploded into EnumByNameColumnMapper and EnumByOrdinalColumnMapper?\r\n* `parameter` vs `paramater`\r\n* Binder.bind needs a resolved parameter type argument to address #242 ","created_at":"2015-11-20T07:46:47Z","updated_at":"2015-12-30T23:29:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c9508350a6039c4d2f52ac1616aa08ab4463c1bc","assignee":{"login":"qualidafial","id":38629,"avatar_url":"https://avatars.githubusercontent.com/u/38629?v=3","gravatar_id":"","url":"https://api.github.com/users/qualidafial","html_url":"https://github.com/qualidafial","followers_url":"https://api.github.com/users/qualidafial/followers","following_url":"https://api.github.com/users/qualidafial/following{/other_user}","gists_url":"https://api.github.com/users/qualidafial/gists{/gist_id}","starred_url":"https://api.github.com/users/qualidafial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qualidafial/subscriptions","organizations_url":"https://api.github.com/users/qualidafial/orgs","repos_url":"https://api.github.com/users/qualidafial/repos","events_url":"https://api.github.com/users/qualidafial/events{/privacy}","received_events_url":"https://api.github.com/users/qualidafial/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/jdbi/jdbi/milestones/2","html_url":"https://github.com/jdbi/jdbi/milestones/JDBI%203","labels_url":"https://api.github.com/repos/jdbi/jdbi/milestones/2/labels","id":382959,"number":2,"title":"JDBI 3","description":"Bucket for issues that should be in JDBI 3","creator":{"login":"stevenschlansker","id":129097,"avatar_url":"https://avatars.githubusercontent.com/u/129097?v=3","gravatar_id":"","url":"https://api.github.com/users/stevenschlansker","html_url":"https://github.com/stevenschlansker","followers_url":"https://api.github.com/users/stevenschlansker/followers","following_url":"https://api.github.com/users/stevenschlansker/following{/other_user}","gists_url":"https://api.github.com/users/stevenschlansker/gists{/gist_id}","starred_url":"https://api.github.com/users/stevenschlansker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevenschlansker/subscriptions","organizations_url":"https://api.github.com/users/stevenschlansker/orgs","repos_url":"https://api.github.com/users/stevenschlansker/repos","events_url":"https://api.github.com/users/stevenschlansker/events{/privacy}","received_events_url":"https://api.github.com/users/stevenschlansker/received_events","type":"User","site_admin":false},"open_issues":17,"closed_issues":27,"state":"open","created_at":"2013-07-20T23:48:16Z","updated_at":"2015-12-29T21:34:29Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/jdbi/jdbi/pulls/235/commits","review_comments_url":"https://api.github.com/repos/jdbi/jdbi/pulls/235/comments","review_comment_url":"https://api.github.com/repos/jdbi/jdbi/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jdbi/jdbi/issues/235/comments","statuses_url":"https://api.github.com/repos/jdbi/jdbi/statuses/9500416eae32c6f23659cdab70de653a7a1aa900","head":{"label":"qualidafial:jdbi3-type-tokens","ref":"jdbi3-type-tokens","sha":"9500416eae32c6f23659cdab70de653a7a1aa900","user":{"login":"qualidafial","id":38629,"avatar_url":"https://avatars.githubusercontent.com/u/38629?v=3","gravatar_id":"","url":"https://api.github.com/users/qualidafial","html_url":"https://github.com/qualidafial","followers_url":"https://api.github.com/users/qualidafial/followers","following_url":"https://api.github.com/users/qualidafial/following{/other_user}","gists_url":"https://api.github.com/users/qualidafial/gists{/gist_id}","starred_url":"https://api.github.com/users/qualidafial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qualidafial/subscriptions","organizations_url":"https://api.github.com/users/qualidafial/orgs","repos_url":"https://api.github.com/users/qualidafial/repos","events_url":"https://api.github.com/users/qualidafial/events{/privacy}","received_events_url":"https://api.github.com/users/qualidafial/received_events","type":"User","site_admin":false},"repo":{"id":43560141,"name":"jdbi","full_name":"qualidafial/jdbi","owner":{"login":"qualidafial","id":38629,"avatar_url":"https://avatars.githubusercontent.com/u/38629?v=3","gravatar_id":"","url":"https://api.github.com/users/qualidafial","html_url":"https://github.com/qualidafial","followers_url":"https://api.github.com/users/qualidafial/followers","following_url":"https://api.github.com/users/qualidafial/following{/other_user}","gists_url":"https://api.github.com/users/qualidafial/gists{/gist_id}","starred_url":"https://api.github.com/users/qualidafial/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qualidafial/subscriptions","organizations_url":"https://api.github.com/users/qualidafial/orgs","repos_url":"https://api.github.com/users/qualidafial/repos","events_url":"https://api.github.com/users/qualidafial/events{/privacy}","received_events_url":"https://api.github.com/users/qualidafial/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/qualidafial/jdbi","description":"jDBI is designed to provide convenient tabular data access in Java(tm). It uses the Java collections framework for query results, provides a convenient means of externalizing sql statements, and provides named parameter support for any database being used.","fork":true,"url":"https://api.github.com/repos/qualidafial/jdbi","forks_url":"https://api.github.com/repos/qualidafial/jdbi/forks","keys_url":"https://api.github.com/repos/qualidafial/jdbi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qualidafial/jdbi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qualidafial/jdbi/teams","hooks_url":"https://api.github.com/repos/qualidafial/jdbi/hooks","issue_events_url":"https://api.github.com/repos/qualidafial/jdbi/issues/events{/number}","events_url":"https://api.github.com/repos/qualidafial/jdbi/events","assignees_url":"https://api.github.com/repos/qualidafial/jdbi/assignees{/user}","branches_url":"https://api.github.com/repos/qualidafial/jdbi/branches{/branch}","tags_url":"https://api.github.com/repos/qualidafial/jdbi/tags","blobs_url":"https://api.github.com/repos/qualidafial/jdbi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qualidafial/jdbi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qualidafial/jdbi/git/refs{/sha}","trees_url":"https://api.github.com/repos/qualidafial/jdbi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qualidafial/jdbi/statuses/{sha}","languages_url":"https://api.github.com/repos/qualidafial/jdbi/languages","stargazers_url":"https://api.github.com/repos/qualidafial/jdbi/stargazers","contributors_url":"https://api.github.com/repos/qualidafial/jdbi/contributors","subscribers_url":"https://api.github.com/repos/qualidafial/jdbi/subscribers","subscription_url":"https://api.github.com/repos/qualidafial/jdbi/subscription","commits_url":"https://api.github.com/repos/qualidafial/jdbi/commits{/sha}","git_commits_url":"https://api.github.com/repos/qualidafial/jdbi/git/commits{/sha}","comments_url":"https://api.github.com/repos/qualidafial/jdbi/comments{/number}","issue_comment_url":"https://api.github.com/repos/qualidafial/jdbi/issues/comments{/number}","contents_url":"https://api.github.com/repos/qualidafial/jdbi/contents/{+path}","compare_url":"https://api.github.com/repos/qualidafial/jdbi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qualidafial/jdbi/merges","archive_url":"https://api.github.com/repos/qualidafial/jdbi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qualidafial/jdbi/downloads","issues_url":"https://api.github.com/repos/qualidafial/jdbi/issues{/number}","pulls_url":"https://api.github.com/repos/qualidafial/jdbi/pulls{/number}","milestones_url":"https://api.github.com/repos/qualidafial/jdbi/milestones{/number}","notifications_url":"https://api.github.com/repos/qualidafial/jdbi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qualidafial/jdbi/labels{/name}","releases_url":"https://api.github.com/repos/qualidafial/jdbi/releases{/id}","created_at":"2015-10-02T15:20:45Z","updated_at":"2015-10-02T15:20:47Z","pushed_at":"2015-12-30T05:03:45Z","git_url":"git://github.com/qualidafial/jdbi.git","ssh_url":"git@github.com:qualidafial/jdbi.git","clone_url":"https://github.com/qualidafial/jdbi.git","svn_url":"https://github.com/qualidafial/jdbi","homepage":"http://jdbi.org/","size":12926,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"jdbi3"}},"base":{"label":"jdbi:jdbi3","ref":"jdbi3","sha":"dd3466f5ccfd3a2a8350e9a310e69d051ebadce2","user":{"login":"jdbi","id":9668860,"avatar_url":"https://avatars.githubusercontent.com/u/9668860?v=3","gravatar_id":"","url":"https://api.github.com/users/jdbi","html_url":"https://github.com/jdbi","followers_url":"https://api.github.com/users/jdbi/followers","following_url":"https://api.github.com/users/jdbi/following{/other_user}","gists_url":"https://api.github.com/users/jdbi/gists{/gist_id}","starred_url":"https://api.github.com/users/jdbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdbi/subscriptions","organizations_url":"https://api.github.com/users/jdbi/orgs","repos_url":"https://api.github.com/users/jdbi/repos","events_url":"https://api.github.com/users/jdbi/events{/privacy}","received_events_url":"https://api.github.com/users/jdbi/received_events","type":"Organization","site_admin":false},"repo":{"id":229738,"name":"jdbi","full_name":"jdbi/jdbi","owner":{"login":"jdbi","id":9668860,"avatar_url":"https://avatars.githubusercontent.com/u/9668860?v=3","gravatar_id":"","url":"https://api.github.com/users/jdbi","html_url":"https://github.com/jdbi","followers_url":"https://api.github.com/users/jdbi/followers","following_url":"https://api.github.com/users/jdbi/following{/other_user}","gists_url":"https://api.github.com/users/jdbi/gists{/gist_id}","starred_url":"https://api.github.com/users/jdbi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdbi/subscriptions","organizations_url":"https://api.github.com/users/jdbi/orgs","repos_url":"https://api.github.com/users/jdbi/repos","events_url":"https://api.github.com/users/jdbi/events{/privacy}","received_events_url":"https://api.github.com/users/jdbi/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jdbi/jdbi","description":"jDBI is designed to provide convenient tabular data access in Java(tm). It uses the Java collections framework for query results, provides a convenient means of externalizing sql statements, and provides named parameter support for any database being used.","fork":false,"url":"https://api.github.com/repos/jdbi/jdbi","forks_url":"https://api.github.com/repos/jdbi/jdbi/forks","keys_url":"https://api.github.com/repos/jdbi/jdbi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jdbi/jdbi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jdbi/jdbi/teams","hooks_url":"https://api.github.com/repos/jdbi/jdbi/hooks","issue_events_url":"https://api.github.com/repos/jdbi/jdbi/issues/events{/number}","events_url":"https://api.github.com/repos/jdbi/jdbi/events","assignees_url":"https://api.github.com/repos/jdbi/jdbi/assignees{/user}","branches_url":"https://api.github.com/repos/jdbi/jdbi/branches{/branch}","tags_url":"https://api.github.com/repos/jdbi/jdbi/tags","blobs_url":"https://api.github.com/repos/jdbi/jdbi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jdbi/jdbi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jdbi/jdbi/git/refs{/sha}","trees_url":"https://api.github.com/repos/jdbi/jdbi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jdbi/jdbi/statuses/{sha}","languages_url":"https://api.github.com/repos/jdbi/jdbi/languages","stargazers_url":"https://api.github.com/repos/jdbi/jdbi/stargazers","contributors_url":"https://api.github.com/repos/jdbi/jdbi/contributors","subscribers_url":"https://api.github.com/repos/jdbi/jdbi/subscribers","subscription_url":"https://api.github.com/repos/jdbi/jdbi/subscription","commits_url":"https://api.github.com/repos/jdbi/jdbi/commits{/sha}","git_commits_url":"https://api.github.com/repos/jdbi/jdbi/git/commits{/sha}","comments_url":"https://api.github.com/repos/jdbi/jdbi/comments{/number}","issue_comment_url":"https://api.github.com/repos/jdbi/jdbi/issues/comments{/number}","contents_url":"https://api.github.com/repos/jdbi/jdbi/contents/{+path}","compare_url":"https://api.github.com/repos/jdbi/jdbi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jdbi/jdbi/merges","archive_url":"https://api.github.com/repos/jdbi/jdbi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jdbi/jdbi/downloads","issues_url":"https://api.github.com/repos/jdbi/jdbi/issues{/number}","pulls_url":"https://api.github.com/repos/jdbi/jdbi/pulls{/number}","milestones_url":"https://api.github.com/repos/jdbi/jdbi/milestones{/number}","notifications_url":"https://api.github.com/repos/jdbi/jdbi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jdbi/jdbi/labels{/name}","releases_url":"https://api.github.com/repos/jdbi/jdbi/releases{/id}","created_at":"2009-06-17T16:36:36Z","updated_at":"2015-12-28T09:23:24Z","pushed_at":"2015-12-30T05:03:46Z","git_url":"git://github.com/jdbi/jdbi.git","ssh_url":"git@github.com:jdbi/jdbi.git","clone_url":"https://github.com/jdbi/jdbi.git","svn_url":"https://github.com/jdbi/jdbi","homepage":"http://jdbi.org/","size":13218,"stargazers_count":557,"watchers_count":557,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":129,"mirror_url":null,"open_issues_count":34,"forks":129,"open_issues":34,"watchers":557,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jdbi/jdbi/pulls/235"},"html":{"href":"https://github.com/jdbi/jdbi/pull/235"},"issue":{"href":"https://api.github.com/repos/jdbi/jdbi/issues/235"},"comments":{"href":"https://api.github.com/repos/jdbi/jdbi/issues/235/comments"},"review_comments":{"href":"https://api.github.com/repos/jdbi/jdbi/pulls/235/comments"},"review_comment":{"href":"https://api.github.com/repos/jdbi/jdbi/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jdbi/jdbi/pulls/235/commits"},"statuses":{"href":"https://api.github.com/repos/jdbi/jdbi/statuses/9500416eae32c6f23659cdab70de653a7a1aa900"}}}}