{"action":"created","comment":{"url":"https://api.github.com/repos/cr0wbar/Bananarama/pulls/comments/72856958","id":72856958,"diff_hunk":"@@ -42,10 +42,18 @@\n     \n     private final StripedLock slock;\n     private final Map<Class<?>, Adapter<?>> adapters;\n-    private static final Map<Class<?>, Class<? extends Adapter>> customAdapters = new ConcurrentHashMap<>();\n+    private final Map<Class<?>, Class<? extends Adapter>> customAdapters = new ConcurrentHashMap<>();\n     \n-    public static void registerAdapter(Class<? extends Adapter> adapter, Class forEntiy) {\n+    /**\n+     * Map the specified {@link Adapter} for a given entity. \n+     * This method is usefull to allow final class from external libraries to be managed by BananaRama\n+     * @param adapter\n+     * @param forEntiy \n+     * @return this instance\n+     */\n+    public BananaRama registerAdapter(Class<? extends Adapter> adapter, Class forEntiy) {","path":"src/main/java/org/bananarama/BananaRama.java","position":21,"original_position":15,"commit_id":"55e1e67d853e226dad2af16e68913dd7fa2a44bd","original_commit_id":"e95deca981d2562b2cd7ead23459f01b1b40c456","user":{"login":"totomz","id":2937573,"avatar_url":"https://avatars.githubusercontent.com/u/2937573?v=3","gravatar_id":"","url":"https://api.github.com/users/totomz","html_url":"https://github.com/totomz","followers_url":"https://api.github.com/users/totomz/followers","following_url":"https://api.github.com/users/totomz/following{/other_user}","gists_url":"https://api.github.com/users/totomz/gists{/gist_id}","starred_url":"https://api.github.com/users/totomz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totomz/subscriptions","organizations_url":"https://api.github.com/users/totomz/orgs","repos_url":"https://api.github.com/users/totomz/repos","events_url":"https://api.github.com/users/totomz/events{/privacy}","received_events_url":"https://api.github.com/users/totomz/received_events","type":"User","site_admin":false},"body":"Yep, but this is the required behaviour....","created_at":"2016-07-29T20:39:43Z","updated_at":"2016-07-29T20:39:43Z","html_url":"https://github.com/cr0wbar/Bananarama/pull/2#discussion_r72856958","pull_request_url":"https://api.github.com/repos/cr0wbar/Bananarama/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/cr0wbar/Bananarama/pulls/comments/72856958"},"html":{"href":"https://github.com/cr0wbar/Bananarama/pull/2#discussion_r72856958"},"pull_request":{"href":"https://api.github.com/repos/cr0wbar/Bananarama/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/cr0wbar/Bananarama/pulls/2","id":79418505,"html_url":"https://github.com/cr0wbar/Bananarama/pull/2","diff_url":"https://github.com/cr0wbar/Bananarama/pull/2.diff","patch_url":"https://github.com/cr0wbar/Bananarama/pull/2.patch","issue_url":"https://api.github.com/repos/cr0wbar/Bananarama/issues/2","number":2,"state":"open","locked":false,"title":"Override declared adapter at runtime","user":{"login":"totomz","id":2937573,"avatar_url":"https://avatars.githubusercontent.com/u/2937573?v=3","gravatar_id":"","url":"https://api.github.com/users/totomz","html_url":"https://github.com/totomz","followers_url":"https://api.github.com/users/totomz/followers","following_url":"https://api.github.com/users/totomz/following{/other_user}","gists_url":"https://api.github.com/users/totomz/gists{/gist_id}","starred_url":"https://api.github.com/users/totomz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totomz/subscriptions","organizations_url":"https://api.github.com/users/totomz/orgs","repos_url":"https://api.github.com/users/totomz/repos","events_url":"https://api.github.com/users/totomz/events{/privacy}","received_events_url":"https://api.github.com/users/totomz/received_events","type":"User","site_admin":false},"body":"With this change it is possible to\r\n* override, at runtime, the declared adapter for a class.\r\n* register an adapter for a final class that declared in a library, for which is impossible to add an annotation at compile time.\r\n\r\nThe usecase is the same defined in the test: a class (`SimpleObj`) that is persisted using a dto (`SimpleDto`); so `SimpleObj` is annotated with `@Banana(adapter = MagicAdapter.class)`. \r\nWe can consider `SimpleDto` as a class declared in an external library\r\n\r\nIn this case, `BananaRama.using()` overrides only the first adapter, so it is not a working alternative","created_at":"2016-07-29T20:23:17Z","updated_at":"2016-07-29T20:39:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"44f441410b560c0817e87c31423ed8b54e023818","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cr0wbar/Bananarama/pulls/2/commits","review_comments_url":"https://api.github.com/repos/cr0wbar/Bananarama/pulls/2/comments","review_comment_url":"https://api.github.com/repos/cr0wbar/Bananarama/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cr0wbar/Bananarama/issues/2/comments","statuses_url":"https://api.github.com/repos/cr0wbar/Bananarama/statuses/55e1e67d853e226dad2af16e68913dd7fa2a44bd","head":{"label":"totomz:master","ref":"master","sha":"55e1e67d853e226dad2af16e68913dd7fa2a44bd","user":{"login":"totomz","id":2937573,"avatar_url":"https://avatars.githubusercontent.com/u/2937573?v=3","gravatar_id":"","url":"https://api.github.com/users/totomz","html_url":"https://github.com/totomz","followers_url":"https://api.github.com/users/totomz/followers","following_url":"https://api.github.com/users/totomz/following{/other_user}","gists_url":"https://api.github.com/users/totomz/gists{/gist_id}","starred_url":"https://api.github.com/users/totomz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totomz/subscriptions","organizations_url":"https://api.github.com/users/totomz/orgs","repos_url":"https://api.github.com/users/totomz/repos","events_url":"https://api.github.com/users/totomz/events{/privacy}","received_events_url":"https://api.github.com/users/totomz/received_events","type":"User","site_admin":false},"repo":{"id":64470966,"name":"Bananarama","full_name":"totomz/Bananarama","owner":{"login":"totomz","id":2937573,"avatar_url":"https://avatars.githubusercontent.com/u/2937573?v=3","gravatar_id":"","url":"https://api.github.com/users/totomz","html_url":"https://github.com/totomz","followers_url":"https://api.github.com/users/totomz/followers","following_url":"https://api.github.com/users/totomz/following{/other_user}","gists_url":"https://api.github.com/users/totomz/gists{/gist_id}","starred_url":"https://api.github.com/users/totomz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/totomz/subscriptions","organizations_url":"https://api.github.com/users/totomz/orgs","repos_url":"https://api.github.com/users/totomz/repos","events_url":"https://api.github.com/users/totomz/events{/privacy}","received_events_url":"https://api.github.com/users/totomz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/totomz/Bananarama","description":"A library which aims to provide universal and cross-persistency CRUD functionalities","fork":true,"url":"https://api.github.com/repos/totomz/Bananarama","forks_url":"https://api.github.com/repos/totomz/Bananarama/forks","keys_url":"https://api.github.com/repos/totomz/Bananarama/keys{/key_id}","collaborators_url":"https://api.github.com/repos/totomz/Bananarama/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/totomz/Bananarama/teams","hooks_url":"https://api.github.com/repos/totomz/Bananarama/hooks","issue_events_url":"https://api.github.com/repos/totomz/Bananarama/issues/events{/number}","events_url":"https://api.github.com/repos/totomz/Bananarama/events","assignees_url":"https://api.github.com/repos/totomz/Bananarama/assignees{/user}","branches_url":"https://api.github.com/repos/totomz/Bananarama/branches{/branch}","tags_url":"https://api.github.com/repos/totomz/Bananarama/tags","blobs_url":"https://api.github.com/repos/totomz/Bananarama/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/totomz/Bananarama/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/totomz/Bananarama/git/refs{/sha}","trees_url":"https://api.github.com/repos/totomz/Bananarama/git/trees{/sha}","statuses_url":"https://api.github.com/repos/totomz/Bananarama/statuses/{sha}","languages_url":"https://api.github.com/repos/totomz/Bananarama/languages","stargazers_url":"https://api.github.com/repos/totomz/Bananarama/stargazers","contributors_url":"https://api.github.com/repos/totomz/Bananarama/contributors","subscribers_url":"https://api.github.com/repos/totomz/Bananarama/subscribers","subscription_url":"https://api.github.com/repos/totomz/Bananarama/subscription","commits_url":"https://api.github.com/repos/totomz/Bananarama/commits{/sha}","git_commits_url":"https://api.github.com/repos/totomz/Bananarama/git/commits{/sha}","comments_url":"https://api.github.com/repos/totomz/Bananarama/comments{/number}","issue_comment_url":"https://api.github.com/repos/totomz/Bananarama/issues/comments{/number}","contents_url":"https://api.github.com/repos/totomz/Bananarama/contents/{+path}","compare_url":"https://api.github.com/repos/totomz/Bananarama/compare/{base}...{head}","merges_url":"https://api.github.com/repos/totomz/Bananarama/merges","archive_url":"https://api.github.com/repos/totomz/Bananarama/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/totomz/Bananarama/downloads","issues_url":"https://api.github.com/repos/totomz/Bananarama/issues{/number}","pulls_url":"https://api.github.com/repos/totomz/Bananarama/pulls{/number}","milestones_url":"https://api.github.com/repos/totomz/Bananarama/milestones{/number}","notifications_url":"https://api.github.com/repos/totomz/Bananarama/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/totomz/Bananarama/labels{/name}","releases_url":"https://api.github.com/repos/totomz/Bananarama/releases{/id}","deployments_url":"https://api.github.com/repos/totomz/Bananarama/deployments","created_at":"2016-07-29T10:02:01Z","updated_at":"2016-07-29T10:02:02Z","pushed_at":"2016-07-29T20:36:41Z","git_url":"git://github.com/totomz/Bananarama.git","ssh_url":"git@github.com:totomz/Bananarama.git","clone_url":"https://github.com/totomz/Bananarama.git","svn_url":"https://github.com/totomz/Bananarama","homepage":null,"size":124,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cr0wbar:master","ref":"master","sha":"41cc5481769adef3a98215fbac1ee20408cc101e","user":{"login":"cr0wbar","id":3111368,"avatar_url":"https://avatars.githubusercontent.com/u/3111368?v=3","gravatar_id":"","url":"https://api.github.com/users/cr0wbar","html_url":"https://github.com/cr0wbar","followers_url":"https://api.github.com/users/cr0wbar/followers","following_url":"https://api.github.com/users/cr0wbar/following{/other_user}","gists_url":"https://api.github.com/users/cr0wbar/gists{/gist_id}","starred_url":"https://api.github.com/users/cr0wbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cr0wbar/subscriptions","organizations_url":"https://api.github.com/users/cr0wbar/orgs","repos_url":"https://api.github.com/users/cr0wbar/repos","events_url":"https://api.github.com/users/cr0wbar/events{/privacy}","received_events_url":"https://api.github.com/users/cr0wbar/received_events","type":"User","site_admin":false},"repo":{"id":52825719,"name":"Bananarama","full_name":"cr0wbar/Bananarama","owner":{"login":"cr0wbar","id":3111368,"avatar_url":"https://avatars.githubusercontent.com/u/3111368?v=3","gravatar_id":"","url":"https://api.github.com/users/cr0wbar","html_url":"https://github.com/cr0wbar","followers_url":"https://api.github.com/users/cr0wbar/followers","following_url":"https://api.github.com/users/cr0wbar/following{/other_user}","gists_url":"https://api.github.com/users/cr0wbar/gists{/gist_id}","starred_url":"https://api.github.com/users/cr0wbar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cr0wbar/subscriptions","organizations_url":"https://api.github.com/users/cr0wbar/orgs","repos_url":"https://api.github.com/users/cr0wbar/repos","events_url":"https://api.github.com/users/cr0wbar/events{/privacy}","received_events_url":"https://api.github.com/users/cr0wbar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cr0wbar/Bananarama","description":"A library which aims to provide universal and cross-persistency CRUD functionalities","fork":false,"url":"https://api.github.com/repos/cr0wbar/Bananarama","forks_url":"https://api.github.com/repos/cr0wbar/Bananarama/forks","keys_url":"https://api.github.com/repos/cr0wbar/Bananarama/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cr0wbar/Bananarama/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cr0wbar/Bananarama/teams","hooks_url":"https://api.github.com/repos/cr0wbar/Bananarama/hooks","issue_events_url":"https://api.github.com/repos/cr0wbar/Bananarama/issues/events{/number}","events_url":"https://api.github.com/repos/cr0wbar/Bananarama/events","assignees_url":"https://api.github.com/repos/cr0wbar/Bananarama/assignees{/user}","branches_url":"https://api.github.com/repos/cr0wbar/Bananarama/branches{/branch}","tags_url":"https://api.github.com/repos/cr0wbar/Bananarama/tags","blobs_url":"https://api.github.com/repos/cr0wbar/Bananarama/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cr0wbar/Bananarama/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cr0wbar/Bananarama/git/refs{/sha}","trees_url":"https://api.github.com/repos/cr0wbar/Bananarama/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cr0wbar/Bananarama/statuses/{sha}","languages_url":"https://api.github.com/repos/cr0wbar/Bananarama/languages","stargazers_url":"https://api.github.com/repos/cr0wbar/Bananarama/stargazers","contributors_url":"https://api.github.com/repos/cr0wbar/Bananarama/contributors","subscribers_url":"https://api.github.com/repos/cr0wbar/Bananarama/subscribers","subscription_url":"https://api.github.com/repos/cr0wbar/Bananarama/subscription","commits_url":"https://api.github.com/repos/cr0wbar/Bananarama/commits{/sha}","git_commits_url":"https://api.github.com/repos/cr0wbar/Bananarama/git/commits{/sha}","comments_url":"https://api.github.com/repos/cr0wbar/Bananarama/comments{/number}","issue_comment_url":"https://api.github.com/repos/cr0wbar/Bananarama/issues/comments{/number}","contents_url":"https://api.github.com/repos/cr0wbar/Bananarama/contents/{+path}","compare_url":"https://api.github.com/repos/cr0wbar/Bananarama/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cr0wbar/Bananarama/merges","archive_url":"https://api.github.com/repos/cr0wbar/Bananarama/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cr0wbar/Bananarama/downloads","issues_url":"https://api.github.com/repos/cr0wbar/Bananarama/issues{/number}","pulls_url":"https://api.github.com/repos/cr0wbar/Bananarama/pulls{/number}","milestones_url":"https://api.github.com/repos/cr0wbar/Bananarama/milestones{/number}","notifications_url":"https://api.github.com/repos/cr0wbar/Bananarama/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cr0wbar/Bananarama/labels{/name}","releases_url":"https://api.github.com/repos/cr0wbar/Bananarama/releases{/id}","deployments_url":"https://api.github.com/repos/cr0wbar/Bananarama/deployments","created_at":"2016-02-29T21:22:33Z","updated_at":"2016-06-09T15:23:03Z","pushed_at":"2016-07-29T20:36:41Z","git_url":"git://github.com/cr0wbar/Bananarama.git","ssh_url":"git@github.com:cr0wbar/Bananarama.git","clone_url":"https://github.com/cr0wbar/Bananarama.git","svn_url":"https://github.com/cr0wbar/Bananarama","homepage":null,"size":121,"stargazers_count":3,"watchers_count":3,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":1,"forks":1,"open_issues":1,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cr0wbar/Bananarama/pulls/2"},"html":{"href":"https://github.com/cr0wbar/Bananarama/pull/2"},"issue":{"href":"https://api.github.com/repos/cr0wbar/Bananarama/issues/2"},"comments":{"href":"https://api.github.com/repos/cr0wbar/Bananarama/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/cr0wbar/Bananarama/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/cr0wbar/Bananarama/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cr0wbar/Bananarama/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/cr0wbar/Bananarama/statuses/55e1e67d853e226dad2af16e68913dd7fa2a44bd"}}}}
{"actor":{"display_login":"totomz"}}