{"action":"created","comment":{"url":"https://api.github.com/repos/mongodb/morphia/pulls/comments/83075725","pull_request_review_id":3940454,"id":83075725,"diff_hunk":"@@ -0,0 +1,73 @@\n+/*\n+ * Copyright 2016 MongoDB, Inc.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *   http://www.apache.org/licenses/LICENSE-2.0\n+ *\n+ * Unless required by applicable law or agreed to in writing, software\n+ * distributed under the License is distributed on an \"AS IS\" BASIS,\n+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+ * See the License for the specific language governing permissions and\n+ * limitations under the License.\n+ */\n+\n+package org.mongodb.morphia.converters;\n+\n+import org.bson.types.Decimal128;\n+import org.mongodb.morphia.mapping.MappedField;\n+\n+import java.math.BigDecimal;\n+import java.math.BigInteger;\n+\n+/**\n+ * This provides a convert to/from BigDecimal in applications using the Decimal128 type introduced in the 3.4.0 release of MongoDB.\n+ *\n+ * @mongodb.server.release 3.4\n+ * @see Decimal128\n+ * @since 1.3\n+ */\n+public class BigDecimalConverter extends TypeConverter implements SimpleValueConverter {\n+    @Override\n+    public Object decode(final Class<?> targetClass, final Object value, final MappedField optionalExtraInfo) {\n+        if (value == null) {\n+            return null;\n+        }\n+\n+        if (value instanceof BigDecimal) {","path":"morphia/src/main/java/org/mongodb/morphia/converters/BigDecimalConverter.java","position":39,"original_position":39,"commit_id":"99c0a5fc694719548364f0544ee7021cd80f0aec","original_commit_id":"99c0a5fc694719548364f0544ee7021cd80f0aec","user":{"login":"evanchooly","id":195021,"avatar_url":"https://avatars.githubusercontent.com/u/195021?v=3","gravatar_id":"","url":"https://api.github.com/users/evanchooly","html_url":"https://github.com/evanchooly","followers_url":"https://api.github.com/users/evanchooly/followers","following_url":"https://api.github.com/users/evanchooly/following{/other_user}","gists_url":"https://api.github.com/users/evanchooly/gists{/gist_id}","starred_url":"https://api.github.com/users/evanchooly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evanchooly/subscriptions","organizations_url":"https://api.github.com/users/evanchooly/orgs","repos_url":"https://api.github.com/users/evanchooly/repos","events_url":"https://api.github.com/users/evanchooly/events{/privacy}","received_events_url":"https://api.github.com/users/evanchooly/received_events","type":"User","site_admin":false},"body":"Most of the converters allow for some flexibility in the types coming from the database so long as they're convertible to the Java types in the class.","created_at":"2016-10-12T19:02:25Z","updated_at":"2016-10-12T19:04:57Z","html_url":"https://github.com/mongodb/morphia/pull/1040#discussion_r83075725","pull_request_url":"https://api.github.com/repos/mongodb/morphia/pulls/1040","_links":{"self":{"href":"https://api.github.com/repos/mongodb/morphia/pulls/comments/83075725"},"html":{"href":"https://github.com/mongodb/morphia/pull/1040#discussion_r83075725"},"pull_request":{"href":"https://api.github.com/repos/mongodb/morphia/pulls/1040"}}},"pull_request":{"url":"https://api.github.com/repos/mongodb/morphia/pulls/1040","id":89055314,"html_url":"https://github.com/mongodb/morphia/pull/1040","diff_url":"https://github.com/mongodb/morphia/pull/1040.diff","patch_url":"https://github.com/mongodb/morphia/pull/1040.patch","issue_url":"https://api.github.com/repos/mongodb/morphia/issues/1040","number":1040,"state":"open","locked":false,"title":"BigDecimal support","user":{"login":"evanchooly","id":195021,"avatar_url":"https://avatars.githubusercontent.com/u/195021?v=3","gravatar_id":"","url":"https://api.github.com/users/evanchooly","html_url":"https://github.com/evanchooly","followers_url":"https://api.github.com/users/evanchooly/followers","following_url":"https://api.github.com/users/evanchooly/following{/other_user}","gists_url":"https://api.github.com/users/evanchooly/gists{/gist_id}","starred_url":"https://api.github.com/users/evanchooly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/evanchooly/subscriptions","organizations_url":"https://api.github.com/users/evanchooly/orgs","repos_url":"https://api.github.com/users/evanchooly/repos","events_url":"https://api.github.com/users/evanchooly/events{/privacy}","received_events_url":"https://api.github.com/users/evanchooly/received_events","type":"User","site_admin":false},"body":"This adds support for mapping BigDecimal to Decimal128 and back.","created_at":"2016-10-12T17:08:15Z","updated_at":"2016-10-12T19:04:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ea83ccaec4f5a93a0a7f6afbfff3482852dff7f","assignee":{"login":"rozza","id":420,"avatar_url":"https://avatars.githubusercontent.com/u/420?v=3","gravatar_id":"","url":"https://api.github.com/users/rozza","html_url":"https://github.com/rozza","followers_url":"https://api.github.com/users/rozza/followers","following_url":"https://api.github.com/users/rozza/following{/other_user}","gists_url":"https://api.github.com/users/rozza/gists{/gist_id}","starred_url":"https://api.github.com/users/rozza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rozza/subscriptions","organizations_url":"https://api.github.com/users/rozza/orgs","repos_url":"https://api.github.com/users/rozza/repos","events_url":"https://api.github.com/users/rozza/events{/privacy}","received_events_url":"https://api.github.com/users/rozza/received_events","type":"User","site_admin":false},"assignees":[{"login":"rozza","id":420,"avatar_url":"https://avatars.githubusercontent.com/u/420?v=3","gravatar_id":"","url":"https://api.github.com/users/rozza","html_url":"https://github.com/rozza","followers_url":"https://api.github.com/users/rozza/followers","following_url":"https://api.github.com/users/rozza/following{/other_user}","gists_url":"https://api.github.com/users/rozza/gists{/gist_id}","starred_url":"https://api.github.com/users/rozza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rozza/subscriptions","organizations_url":"https://api.github.com/users/rozza/orgs","repos_url":"https://api.github.com/users/rozza/repos","events_url":"https://api.github.com/users/rozza/events{/privacy}","received_events_url":"https://api.github.com/users/rozza/received_events","type":"User","site_admin":false},{"login":"jyemin","id":1111546,"avatar_url":"https://avatars.githubusercontent.com/u/1111546?v=3","gravatar_id":"","url":"https://api.github.com/users/jyemin","html_url":"https://github.com/jyemin","followers_url":"https://api.github.com/users/jyemin/followers","following_url":"https://api.github.com/users/jyemin/following{/other_user}","gists_url":"https://api.github.com/users/jyemin/gists{/gist_id}","starred_url":"https://api.github.com/users/jyemin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jyemin/subscriptions","organizations_url":"https://api.github.com/users/jyemin/orgs","repos_url":"https://api.github.com/users/jyemin/repos","events_url":"https://api.github.com/users/jyemin/events{/privacy}","received_events_url":"https://api.github.com/users/jyemin/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mongodb/morphia/pulls/1040/commits","review_comments_url":"https://api.github.com/repos/mongodb/morphia/pulls/1040/comments","review_comment_url":"https://api.github.com/repos/mongodb/morphia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mongodb/morphia/issues/1040/comments","statuses_url":"https://api.github.com/repos/mongodb/morphia/statuses/6cb07bb8b8683e4c2a2a05aae379f7840f992f9f","head":{"label":"mongodb:bigdecimal","ref":"bigdecimal","sha":"6cb07bb8b8683e4c2a2a05aae379f7840f992f9f","user":{"login":"mongodb","id":45120,"avatar_url":"https://avatars.githubusercontent.com/u/45120?v=3","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"repo":{"id":9677593,"name":"morphia","full_name":"mongodb/morphia","owner":{"login":"mongodb","id":45120,"avatar_url":"https://avatars.githubusercontent.com/u/45120?v=3","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mongodb/morphia","description":"MongoDB object-document mapper in Java based on https://github.com/mongodb/mongo-java-driver","fork":false,"url":"https://api.github.com/repos/mongodb/morphia","forks_url":"https://api.github.com/repos/mongodb/morphia/forks","keys_url":"https://api.github.com/repos/mongodb/morphia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mongodb/morphia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mongodb/morphia/teams","hooks_url":"https://api.github.com/repos/mongodb/morphia/hooks","issue_events_url":"https://api.github.com/repos/mongodb/morphia/issues/events{/number}","events_url":"https://api.github.com/repos/mongodb/morphia/events","assignees_url":"https://api.github.com/repos/mongodb/morphia/assignees{/user}","branches_url":"https://api.github.com/repos/mongodb/morphia/branches{/branch}","tags_url":"https://api.github.com/repos/mongodb/morphia/tags","blobs_url":"https://api.github.com/repos/mongodb/morphia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mongodb/morphia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mongodb/morphia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mongodb/morphia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mongodb/morphia/statuses/{sha}","languages_url":"https://api.github.com/repos/mongodb/morphia/languages","stargazers_url":"https://api.github.com/repos/mongodb/morphia/stargazers","contributors_url":"https://api.github.com/repos/mongodb/morphia/contributors","subscribers_url":"https://api.github.com/repos/mongodb/morphia/subscribers","subscription_url":"https://api.github.com/repos/mongodb/morphia/subscription","commits_url":"https://api.github.com/repos/mongodb/morphia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mongodb/morphia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mongodb/morphia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mongodb/morphia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mongodb/morphia/contents/{+path}","compare_url":"https://api.github.com/repos/mongodb/morphia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mongodb/morphia/merges","archive_url":"https://api.github.com/repos/mongodb/morphia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mongodb/morphia/downloads","issues_url":"https://api.github.com/repos/mongodb/morphia/issues{/number}","pulls_url":"https://api.github.com/repos/mongodb/morphia/pulls{/number}","milestones_url":"https://api.github.com/repos/mongodb/morphia/milestones{/number}","notifications_url":"https://api.github.com/repos/mongodb/morphia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mongodb/morphia/labels{/name}","releases_url":"https://api.github.com/repos/mongodb/morphia/releases{/id}","deployments_url":"https://api.github.com/repos/mongodb/morphia/deployments","created_at":"2013-04-25T17:41:02Z","updated_at":"2016-10-04T09:03:22Z","pushed_at":"2016-10-12T19:04:56Z","git_url":"git://github.com/mongodb/morphia.git","ssh_url":"git@github.com:mongodb/morphia.git","clone_url":"https://github.com/mongodb/morphia.git","svn_url":"https://github.com/mongodb/morphia","homepage":"","size":14961,"stargazers_count":1017,"watchers_count":1017,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":299,"mirror_url":null,"open_issues_count":128,"forks":299,"open_issues":128,"watchers":1017,"default_branch":"master"}},"base":{"label":"mongodb:master","ref":"master","sha":"ff91539184c5f3b09a2b0bd5f3985ade764faab7","user":{"login":"mongodb","id":45120,"avatar_url":"https://avatars.githubusercontent.com/u/45120?v=3","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"repo":{"id":9677593,"name":"morphia","full_name":"mongodb/morphia","owner":{"login":"mongodb","id":45120,"avatar_url":"https://avatars.githubusercontent.com/u/45120?v=3","gravatar_id":"","url":"https://api.github.com/users/mongodb","html_url":"https://github.com/mongodb","followers_url":"https://api.github.com/users/mongodb/followers","following_url":"https://api.github.com/users/mongodb/following{/other_user}","gists_url":"https://api.github.com/users/mongodb/gists{/gist_id}","starred_url":"https://api.github.com/users/mongodb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mongodb/subscriptions","organizations_url":"https://api.github.com/users/mongodb/orgs","repos_url":"https://api.github.com/users/mongodb/repos","events_url":"https://api.github.com/users/mongodb/events{/privacy}","received_events_url":"https://api.github.com/users/mongodb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mongodb/morphia","description":"MongoDB object-document mapper in Java based on https://github.com/mongodb/mongo-java-driver","fork":false,"url":"https://api.github.com/repos/mongodb/morphia","forks_url":"https://api.github.com/repos/mongodb/morphia/forks","keys_url":"https://api.github.com/repos/mongodb/morphia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mongodb/morphia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mongodb/morphia/teams","hooks_url":"https://api.github.com/repos/mongodb/morphia/hooks","issue_events_url":"https://api.github.com/repos/mongodb/morphia/issues/events{/number}","events_url":"https://api.github.com/repos/mongodb/morphia/events","assignees_url":"https://api.github.com/repos/mongodb/morphia/assignees{/user}","branches_url":"https://api.github.com/repos/mongodb/morphia/branches{/branch}","tags_url":"https://api.github.com/repos/mongodb/morphia/tags","blobs_url":"https://api.github.com/repos/mongodb/morphia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mongodb/morphia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mongodb/morphia/git/refs{/sha}","trees_url":"https://api.github.com/repos/mongodb/morphia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mongodb/morphia/statuses/{sha}","languages_url":"https://api.github.com/repos/mongodb/morphia/languages","stargazers_url":"https://api.github.com/repos/mongodb/morphia/stargazers","contributors_url":"https://api.github.com/repos/mongodb/morphia/contributors","subscribers_url":"https://api.github.com/repos/mongodb/morphia/subscribers","subscription_url":"https://api.github.com/repos/mongodb/morphia/subscription","commits_url":"https://api.github.com/repos/mongodb/morphia/commits{/sha}","git_commits_url":"https://api.github.com/repos/mongodb/morphia/git/commits{/sha}","comments_url":"https://api.github.com/repos/mongodb/morphia/comments{/number}","issue_comment_url":"https://api.github.com/repos/mongodb/morphia/issues/comments{/number}","contents_url":"https://api.github.com/repos/mongodb/morphia/contents/{+path}","compare_url":"https://api.github.com/repos/mongodb/morphia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mongodb/morphia/merges","archive_url":"https://api.github.com/repos/mongodb/morphia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mongodb/morphia/downloads","issues_url":"https://api.github.com/repos/mongodb/morphia/issues{/number}","pulls_url":"https://api.github.com/repos/mongodb/morphia/pulls{/number}","milestones_url":"https://api.github.com/repos/mongodb/morphia/milestones{/number}","notifications_url":"https://api.github.com/repos/mongodb/morphia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mongodb/morphia/labels{/name}","releases_url":"https://api.github.com/repos/mongodb/morphia/releases{/id}","deployments_url":"https://api.github.com/repos/mongodb/morphia/deployments","created_at":"2013-04-25T17:41:02Z","updated_at":"2016-10-04T09:03:22Z","pushed_at":"2016-10-12T19:04:56Z","git_url":"git://github.com/mongodb/morphia.git","ssh_url":"git@github.com:mongodb/morphia.git","clone_url":"https://github.com/mongodb/morphia.git","svn_url":"https://github.com/mongodb/morphia","homepage":"","size":14961,"stargazers_count":1017,"watchers_count":1017,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":299,"mirror_url":null,"open_issues_count":128,"forks":299,"open_issues":128,"watchers":1017,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mongodb/morphia/pulls/1040"},"html":{"href":"https://github.com/mongodb/morphia/pull/1040"},"issue":{"href":"https://api.github.com/repos/mongodb/morphia/issues/1040"},"comments":{"href":"https://api.github.com/repos/mongodb/morphia/issues/1040/comments"},"review_comments":{"href":"https://api.github.com/repos/mongodb/morphia/pulls/1040/comments"},"review_comment":{"href":"https://api.github.com/repos/mongodb/morphia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mongodb/morphia/pulls/1040/commits"},"statuses":{"href":"https://api.github.com/repos/mongodb/morphia/statuses/6cb07bb8b8683e4c2a2a05aae379f7840f992f9f"}}}}
{"actor":{"display_login":"evanchooly"}}