{"action":"created","comment":{"url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/pulls/comments/48989553","id":48989553,"diff_hunk":"@@ -0,0 +1,234 @@\n+/*\n+ * Copyright 2015, TeamDev Ltd. All rights reserved.\n+ *\n+ * Redistribution and use in source and/or binary forms, with or without\n+ * modification, must retain the above copyright notice and the following\n+ * disclaimer.\n+ *\n+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n+ * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n+ */\n+\n+package org.spine3.server.storage.hsqldb;\n+\n+import com.google.protobuf.Any;\n+import com.google.protobuf.ByteString;\n+import com.google.protobuf.Message;\n+import org.slf4j.Logger;\n+import org.slf4j.LoggerFactory;\n+import org.spine3.protobuf.Messages;\n+import org.spine3.server.storage.EntityStorage;\n+import org.spine3.type.TypeName;\n+\n+import javax.annotation.Nullable;\n+import java.sql.PreparedStatement;\n+import java.sql.ResultSet;\n+import java.sql.SQLException;\n+\n+import static com.google.common.base.Preconditions.checkNotNull;\n+import static com.google.common.base.Throwables.propagate;\n+import static com.google.protobuf.Descriptors.Descriptor;\n+import static org.spine3.protobuf.Messages.toAny;\n+import static org.spine3.util.Identifiers.idToString;\n+\n+/**\n+ * The implementation of the entity storage based on HyperSQL Database.\n+ *\n+ * @see HsqlStorageFactory\n+ * @author Alexander Litus\n+ */\n+@SuppressWarnings(\"DuplicateStringLiteralInspection\")\n+class HsqlEntityStorage<I, M extends Message> extends EntityStorage<I, M> implements AutoCloseable {","path":"hsqldb/src/main/java/org/spine3/server/storage/hsqldb/HsqlEntityStorage.java","position":50,"original_position":50,"commit_id":"ecb0c8a17f5f1e941c8934ad75132dfc3a6c6f6e","original_commit_id":"ecb0c8a17f5f1e941c8934ad75132dfc3a6c6f6e","user":{"login":"alexander-yevsyukov","id":3116444,"avatar_url":"https://avatars.githubusercontent.com/u/3116444?v=3","gravatar_id":"","url":"https://api.github.com/users/alexander-yevsyukov","html_url":"https://github.com/alexander-yevsyukov","followers_url":"https://api.github.com/users/alexander-yevsyukov/followers","following_url":"https://api.github.com/users/alexander-yevsyukov/following{/other_user}","gists_url":"https://api.github.com/users/alexander-yevsyukov/gists{/gist_id}","starred_url":"https://api.github.com/users/alexander-yevsyukov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexander-yevsyukov/subscriptions","organizations_url":"https://api.github.com/users/alexander-yevsyukov/orgs","repos_url":"https://api.github.com/users/alexander-yevsyukov/repos","events_url":"https://api.github.com/users/alexander-yevsyukov/events{/privacy}","received_events_url":"https://api.github.com/users/alexander-yevsyukov/received_events","type":"User","site_admin":false},"body":"What details of this entity storage are specific to HSQL?\r\nHow would look an entity storager for MySQL, or for Oracle?","created_at":"2016-01-06T18:20:18Z","updated_at":"2016-01-06T18:20:18Z","html_url":"https://github.com/SpineEventEngine/jdbc-storage/pull/1#discussion_r48989553","pull_request_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/pulls/comments/48989553"},"html":{"href":"https://github.com/SpineEventEngine/jdbc-storage/pull/1#discussion_r48989553"},"pull_request":{"href":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/pulls/1","id":55236577,"html_url":"https://github.com/SpineEventEngine/jdbc-storage/pull/1","diff_url":"https://github.com/SpineEventEngine/jdbc-storage/pull/1.diff","patch_url":"https://github.com/SpineEventEngine/jdbc-storage/pull/1.patch","issue_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/issues/1","number":1,"state":"open","locked":false,"title":"Entity storage","user":{"login":"AlexanderLitus","id":8298183,"avatar_url":"https://avatars.githubusercontent.com/u/8298183?v=3","gravatar_id":"","url":"https://api.github.com/users/AlexanderLitus","html_url":"https://github.com/AlexanderLitus","followers_url":"https://api.github.com/users/AlexanderLitus/followers","following_url":"https://api.github.com/users/AlexanderLitus/following{/other_user}","gists_url":"https://api.github.com/users/AlexanderLitus/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexanderLitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexanderLitus/subscriptions","organizations_url":"https://api.github.com/users/AlexanderLitus/orgs","repos_url":"https://api.github.com/users/AlexanderLitus/repos","events_url":"https://api.github.com/users/AlexanderLitus/events{/privacy}","received_events_url":"https://api.github.com/users/AlexanderLitus/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-01-06T17:02:23Z","updated_at":"2016-01-06T18:20:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b980feada783886324a26003d2cc5acab0ed0848","assignee":{"login":"alexander-yevsyukov","id":3116444,"avatar_url":"https://avatars.githubusercontent.com/u/3116444?v=3","gravatar_id":"","url":"https://api.github.com/users/alexander-yevsyukov","html_url":"https://github.com/alexander-yevsyukov","followers_url":"https://api.github.com/users/alexander-yevsyukov/followers","following_url":"https://api.github.com/users/alexander-yevsyukov/following{/other_user}","gists_url":"https://api.github.com/users/alexander-yevsyukov/gists{/gist_id}","starred_url":"https://api.github.com/users/alexander-yevsyukov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexander-yevsyukov/subscriptions","organizations_url":"https://api.github.com/users/alexander-yevsyukov/orgs","repos_url":"https://api.github.com/users/alexander-yevsyukov/repos","events_url":"https://api.github.com/users/alexander-yevsyukov/events{/privacy}","received_events_url":"https://api.github.com/users/alexander-yevsyukov/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/pulls/1/commits","review_comments_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/pulls/1/comments","review_comment_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/issues/1/comments","statuses_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/statuses/ecb0c8a17f5f1e941c8934ad75132dfc3a6c6f6e","head":{"label":"SpineEventEngine:entity-storage","ref":"entity-storage","sha":"ecb0c8a17f5f1e941c8934ad75132dfc3a6c6f6e","user":{"login":"SpineEventEngine","id":12821626,"avatar_url":"https://avatars.githubusercontent.com/u/12821626?v=3","gravatar_id":"","url":"https://api.github.com/users/SpineEventEngine","html_url":"https://github.com/SpineEventEngine","followers_url":"https://api.github.com/users/SpineEventEngine/followers","following_url":"https://api.github.com/users/SpineEventEngine/following{/other_user}","gists_url":"https://api.github.com/users/SpineEventEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/SpineEventEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpineEventEngine/subscriptions","organizations_url":"https://api.github.com/users/SpineEventEngine/orgs","repos_url":"https://api.github.com/users/SpineEventEngine/repos","events_url":"https://api.github.com/users/SpineEventEngine/events{/privacy}","received_events_url":"https://api.github.com/users/SpineEventEngine/received_events","type":"Organization","site_admin":false},"repo":{"id":48777453,"name":"jdbc-storage","full_name":"SpineEventEngine/jdbc-storage","owner":{"login":"SpineEventEngine","id":12821626,"avatar_url":"https://avatars.githubusercontent.com/u/12821626?v=3","gravatar_id":"","url":"https://api.github.com/users/SpineEventEngine","html_url":"https://github.com/SpineEventEngine","followers_url":"https://api.github.com/users/SpineEventEngine/followers","following_url":"https://api.github.com/users/SpineEventEngine/following{/other_user}","gists_url":"https://api.github.com/users/SpineEventEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/SpineEventEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpineEventEngine/subscriptions","organizations_url":"https://api.github.com/users/SpineEventEngine/orgs","repos_url":"https://api.github.com/users/SpineEventEngine/repos","events_url":"https://api.github.com/users/SpineEventEngine/events{/privacy}","received_events_url":"https://api.github.com/users/SpineEventEngine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpineEventEngine/jdbc-storage","description":"Support of storage in JDBC-compliant databases","fork":false,"url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage","forks_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/forks","keys_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/teams","hooks_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/hooks","issue_events_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/issues/events{/number}","events_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/events","assignees_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/assignees{/user}","branches_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/branches{/branch}","tags_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/tags","blobs_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/statuses/{sha}","languages_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/languages","stargazers_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/stargazers","contributors_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/contributors","subscribers_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/subscribers","subscription_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/subscription","commits_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/contents/{+path}","compare_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/merges","archive_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/downloads","issues_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/issues{/number}","pulls_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/pulls{/number}","milestones_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/milestones{/number}","notifications_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/labels{/name}","releases_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/releases{/id}","created_at":"2015-12-30T02:36:43Z","updated_at":"2015-12-30T02:36:43Z","pushed_at":"2016-01-06T17:02:24Z","git_url":"git://github.com/SpineEventEngine/jdbc-storage.git","ssh_url":"git@github.com:SpineEventEngine/jdbc-storage.git","clone_url":"https://github.com/SpineEventEngine/jdbc-storage.git","svn_url":"https://github.com/SpineEventEngine/jdbc-storage","homepage":null,"size":81,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"SpineEventEngine:master","ref":"master","sha":"67a2f34943ef0cd31a63c19efc3404e10f52ef1e","user":{"login":"SpineEventEngine","id":12821626,"avatar_url":"https://avatars.githubusercontent.com/u/12821626?v=3","gravatar_id":"","url":"https://api.github.com/users/SpineEventEngine","html_url":"https://github.com/SpineEventEngine","followers_url":"https://api.github.com/users/SpineEventEngine/followers","following_url":"https://api.github.com/users/SpineEventEngine/following{/other_user}","gists_url":"https://api.github.com/users/SpineEventEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/SpineEventEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpineEventEngine/subscriptions","organizations_url":"https://api.github.com/users/SpineEventEngine/orgs","repos_url":"https://api.github.com/users/SpineEventEngine/repos","events_url":"https://api.github.com/users/SpineEventEngine/events{/privacy}","received_events_url":"https://api.github.com/users/SpineEventEngine/received_events","type":"Organization","site_admin":false},"repo":{"id":48777453,"name":"jdbc-storage","full_name":"SpineEventEngine/jdbc-storage","owner":{"login":"SpineEventEngine","id":12821626,"avatar_url":"https://avatars.githubusercontent.com/u/12821626?v=3","gravatar_id":"","url":"https://api.github.com/users/SpineEventEngine","html_url":"https://github.com/SpineEventEngine","followers_url":"https://api.github.com/users/SpineEventEngine/followers","following_url":"https://api.github.com/users/SpineEventEngine/following{/other_user}","gists_url":"https://api.github.com/users/SpineEventEngine/gists{/gist_id}","starred_url":"https://api.github.com/users/SpineEventEngine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SpineEventEngine/subscriptions","organizations_url":"https://api.github.com/users/SpineEventEngine/orgs","repos_url":"https://api.github.com/users/SpineEventEngine/repos","events_url":"https://api.github.com/users/SpineEventEngine/events{/privacy}","received_events_url":"https://api.github.com/users/SpineEventEngine/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SpineEventEngine/jdbc-storage","description":"Support of storage in JDBC-compliant databases","fork":false,"url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage","forks_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/forks","keys_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/teams","hooks_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/hooks","issue_events_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/issues/events{/number}","events_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/events","assignees_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/assignees{/user}","branches_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/branches{/branch}","tags_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/tags","blobs_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/git/refs{/sha}","trees_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/statuses/{sha}","languages_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/languages","stargazers_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/stargazers","contributors_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/contributors","subscribers_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/subscribers","subscription_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/subscription","commits_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/commits{/sha}","git_commits_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/git/commits{/sha}","comments_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/comments{/number}","issue_comment_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/issues/comments{/number}","contents_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/contents/{+path}","compare_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/merges","archive_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/downloads","issues_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/issues{/number}","pulls_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/pulls{/number}","milestones_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/milestones{/number}","notifications_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/labels{/name}","releases_url":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/releases{/id}","created_at":"2015-12-30T02:36:43Z","updated_at":"2015-12-30T02:36:43Z","pushed_at":"2016-01-06T17:02:24Z","git_url":"git://github.com/SpineEventEngine/jdbc-storage.git","ssh_url":"git@github.com:SpineEventEngine/jdbc-storage.git","clone_url":"https://github.com/SpineEventEngine/jdbc-storage.git","svn_url":"https://github.com/SpineEventEngine/jdbc-storage","homepage":null,"size":81,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/pulls/1"},"html":{"href":"https://github.com/SpineEventEngine/jdbc-storage/pull/1"},"issue":{"href":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/issues/1"},"comments":{"href":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/SpineEventEngine/jdbc-storage/statuses/ecb0c8a17f5f1e941c8934ad75132dfc3a6c6f6e"}}}}