{"action":"created","comment":{"url":"https://api.github.com/repos/corda/corda/pulls/comments/111989777","pull_request_review_id":33254729,"id":111989777,"diff_hunk":"@@ -0,0 +1,114 @@\n+package net.corda.core.node.services.vault\n+\n+import io.requery.kotlin.Logical\n+import io.requery.query.Condition\n+import io.requery.query.Operator\n+import io.requery.query.Order\n+import net.corda.core.contracts.ContractState\n+import net.corda.core.contracts.StateRef\n+import net.corda.core.contracts.UniqueIdentifier\n+import net.corda.core.crypto.CompositeKey\n+import net.corda.core.crypto.Party\n+import net.corda.core.node.services.Vault\n+import net.corda.core.node.services.vault.QueryCriteria.*\n+import net.corda.core.serialization.OpaqueBytes\n+import java.time.Instant\n+\n+/**\n+ * Indexing assumptions:\n+ * QueryCriteria assumes underlying schema tables are correctly indexed for performance.\n+ *\n+ */\n+\n+sealed class QueryCriteria {\n+\n+    /**\n+     * VaultQueryCriteria: provides query by attributes defined in [VaultSchema.VaultStates]\n+     * plus simple paging and sorting.\n+     */\n+    data class VaultQueryCriteria @JvmOverloads constructor (\n+            val status: Vault.StateStatus = Vault.StateStatus.UNCONSUMED,\n+            val stateRefs: Collection<StateRef>? = null,\n+            val contractStateTypes: Set<Class<out ContractState>>? = null,\n+            val notary: Collection<Party>? = null,\n+            val includeSoftlocks: Boolean? = true,\n+            val timeCondition: LogicalExpression<TimeInstantType, Array<Instant>>? = null,\n+            val paging: PageSpecification? = null,","path":"core/src/main/kotlin/net/corda/core/node/services/vault/QueryCriteria.kt","position":36,"original_position":36,"commit_id":"90437cc3a36bd3210b5968e519eb1894f41f8706","original_commit_id":"5a0c50e946e8d82a2a3e7d5e7f1711141c647a2e","user":{"login":"rick-r3","id":23558791,"avatar_url":"https://avatars1.githubusercontent.com/u/23558791?v=3","gravatar_id":"","url":"https://api.github.com/users/rick-r3","html_url":"https://github.com/rick-r3","followers_url":"https://api.github.com/users/rick-r3/followers","following_url":"https://api.github.com/users/rick-r3/following{/other_user}","gists_url":"https://api.github.com/users/rick-r3/gists{/gist_id}","starred_url":"https://api.github.com/users/rick-r3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rick-r3/subscriptions","organizations_url":"https://api.github.com/users/rick-r3/orgs","repos_url":"https://api.github.com/users/rick-r3/repos","events_url":"https://api.github.com/users/rick-r3/events{/privacy}","received_events_url":"https://api.github.com/users/rick-r3/received_events","type":"User","site_admin":false},"body":"As @exFalso says, move them out of criteria (since they don't compose) and into a parameter of `queryBy`, since we want to be able to apply to any criteria.","created_at":"2017-04-18T15:44:46Z","updated_at":"2017-04-18T15:59:44Z","html_url":"https://github.com/corda/corda/pull/522#discussion_r111989777","pull_request_url":"https://api.github.com/repos/corda/corda/pulls/522","_links":{"self":{"href":"https://api.github.com/repos/corda/corda/pulls/comments/111989777"},"html":{"href":"https://github.com/corda/corda/pull/522#discussion_r111989777"},"pull_request":{"href":"https://api.github.com/repos/corda/corda/pulls/522"}}},"pull_request":{"url":"https://api.github.com/repos/corda/corda/pulls/522","id":114859455,"html_url":"https://github.com/corda/corda/pull/522","diff_url":"https://github.com/corda/corda/pull/522.diff","patch_url":"https://github.com/corda/corda/pull/522.patch","issue_url":"https://api.github.com/repos/corda/corda/issues/522","number":522,"state":"open","locked":false,"title":"Vault Query API design","user":{"login":"josecoll","id":23558646,"avatar_url":"https://avatars3.githubusercontent.com/u/23558646?v=3","gravatar_id":"","url":"https://api.github.com/users/josecoll","html_url":"https://github.com/josecoll","followers_url":"https://api.github.com/users/josecoll/followers","following_url":"https://api.github.com/users/josecoll/following{/other_user}","gists_url":"https://api.github.com/users/josecoll/gists{/gist_id}","starred_url":"https://api.github.com/users/josecoll/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josecoll/subscriptions","organizations_url":"https://api.github.com/users/josecoll/orgs","repos_url":"https://api.github.com/users/josecoll/repos","events_url":"https://api.github.com/users/josecoll/events{/privacy}","received_events_url":"https://api.github.com/users/josecoll/received_events","type":"User","site_admin":false},"body":"Vault Query API service and interfaces specification, associated JUnit tests in both Kotlin and Java demonstrating usability and developer documentation (in RST format).\r\n**Note: there is not implementation so don't expect any new tests to pass.**\r\n","created_at":"2017-04-07T17:05:33Z","updated_at":"2017-04-18T15:59:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"924b12498f2ca436dd25cb909f249c82f0e443ae","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/corda/corda/pulls/522/commits","review_comments_url":"https://api.github.com/repos/corda/corda/pulls/522/comments","review_comment_url":"https://api.github.com/repos/corda/corda/pulls/comments{/number}","comments_url":"https://api.github.com/repos/corda/corda/issues/522/comments","statuses_url":"https://api.github.com/repos/corda/corda/statuses/90437cc3a36bd3210b5968e519eb1894f41f8706","head":{"label":"corda:colljos-vault-query-api","ref":"colljos-vault-query-api","sha":"90437cc3a36bd3210b5968e519eb1894f41f8706","user":{"login":"corda","id":22600631,"avatar_url":"https://avatars2.githubusercontent.com/u/22600631?v=3","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"repo":{"id":70137417,"name":"corda","full_name":"corda/corda","owner":{"login":"corda","id":22600631,"avatar_url":"https://avatars2.githubusercontent.com/u/22600631?v=3","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/corda/corda","description":"Corda is a distributed ledger platform designed to record, manage and automate legal agreements between business partners. Designed by (and for) the world's largest financial institutions, it offers a unique response to the privacy and scalability challenges facing decentralised applications.","fork":false,"url":"https://api.github.com/repos/corda/corda","forks_url":"https://api.github.com/repos/corda/corda/forks","keys_url":"https://api.github.com/repos/corda/corda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/corda/corda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/corda/corda/teams","hooks_url":"https://api.github.com/repos/corda/corda/hooks","issue_events_url":"https://api.github.com/repos/corda/corda/issues/events{/number}","events_url":"https://api.github.com/repos/corda/corda/events","assignees_url":"https://api.github.com/repos/corda/corda/assignees{/user}","branches_url":"https://api.github.com/repos/corda/corda/branches{/branch}","tags_url":"https://api.github.com/repos/corda/corda/tags","blobs_url":"https://api.github.com/repos/corda/corda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/corda/corda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/corda/corda/git/refs{/sha}","trees_url":"https://api.github.com/repos/corda/corda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/corda/corda/statuses/{sha}","languages_url":"https://api.github.com/repos/corda/corda/languages","stargazers_url":"https://api.github.com/repos/corda/corda/stargazers","contributors_url":"https://api.github.com/repos/corda/corda/contributors","subscribers_url":"https://api.github.com/repos/corda/corda/subscribers","subscription_url":"https://api.github.com/repos/corda/corda/subscription","commits_url":"https://api.github.com/repos/corda/corda/commits{/sha}","git_commits_url":"https://api.github.com/repos/corda/corda/git/commits{/sha}","comments_url":"https://api.github.com/repos/corda/corda/comments{/number}","issue_comment_url":"https://api.github.com/repos/corda/corda/issues/comments{/number}","contents_url":"https://api.github.com/repos/corda/corda/contents/{+path}","compare_url":"https://api.github.com/repos/corda/corda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/corda/corda/merges","archive_url":"https://api.github.com/repos/corda/corda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/corda/corda/downloads","issues_url":"https://api.github.com/repos/corda/corda/issues{/number}","pulls_url":"https://api.github.com/repos/corda/corda/pulls{/number}","milestones_url":"https://api.github.com/repos/corda/corda/milestones{/number}","notifications_url":"https://api.github.com/repos/corda/corda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/corda/corda/labels{/name}","releases_url":"https://api.github.com/repos/corda/corda/releases{/id}","deployments_url":"https://api.github.com/repos/corda/corda/deployments","created_at":"2016-10-06T08:46:29Z","updated_at":"2017-04-18T12:19:50Z","pushed_at":"2017-04-18T15:42:47Z","git_url":"git://github.com/corda/corda.git","ssh_url":"git@github.com:corda/corda.git","clone_url":"https://github.com/corda/corda.git","svn_url":"https://github.com/corda/corda","homepage":"https://www.corda.net","size":70084,"stargazers_count":566,"watchers_count":566,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":181,"mirror_url":null,"open_issues_count":49,"forks":181,"open_issues":49,"watchers":566,"default_branch":"master"}},"base":{"label":"corda:master","ref":"master","sha":"868a490bba9cf64ab887c1390adbc4bd55309d03","user":{"login":"corda","id":22600631,"avatar_url":"https://avatars2.githubusercontent.com/u/22600631?v=3","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"repo":{"id":70137417,"name":"corda","full_name":"corda/corda","owner":{"login":"corda","id":22600631,"avatar_url":"https://avatars2.githubusercontent.com/u/22600631?v=3","gravatar_id":"","url":"https://api.github.com/users/corda","html_url":"https://github.com/corda","followers_url":"https://api.github.com/users/corda/followers","following_url":"https://api.github.com/users/corda/following{/other_user}","gists_url":"https://api.github.com/users/corda/gists{/gist_id}","starred_url":"https://api.github.com/users/corda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/corda/subscriptions","organizations_url":"https://api.github.com/users/corda/orgs","repos_url":"https://api.github.com/users/corda/repos","events_url":"https://api.github.com/users/corda/events{/privacy}","received_events_url":"https://api.github.com/users/corda/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/corda/corda","description":"Corda is a distributed ledger platform designed to record, manage and automate legal agreements between business partners. Designed by (and for) the world's largest financial institutions, it offers a unique response to the privacy and scalability challenges facing decentralised applications.","fork":false,"url":"https://api.github.com/repos/corda/corda","forks_url":"https://api.github.com/repos/corda/corda/forks","keys_url":"https://api.github.com/repos/corda/corda/keys{/key_id}","collaborators_url":"https://api.github.com/repos/corda/corda/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/corda/corda/teams","hooks_url":"https://api.github.com/repos/corda/corda/hooks","issue_events_url":"https://api.github.com/repos/corda/corda/issues/events{/number}","events_url":"https://api.github.com/repos/corda/corda/events","assignees_url":"https://api.github.com/repos/corda/corda/assignees{/user}","branches_url":"https://api.github.com/repos/corda/corda/branches{/branch}","tags_url":"https://api.github.com/repos/corda/corda/tags","blobs_url":"https://api.github.com/repos/corda/corda/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/corda/corda/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/corda/corda/git/refs{/sha}","trees_url":"https://api.github.com/repos/corda/corda/git/trees{/sha}","statuses_url":"https://api.github.com/repos/corda/corda/statuses/{sha}","languages_url":"https://api.github.com/repos/corda/corda/languages","stargazers_url":"https://api.github.com/repos/corda/corda/stargazers","contributors_url":"https://api.github.com/repos/corda/corda/contributors","subscribers_url":"https://api.github.com/repos/corda/corda/subscribers","subscription_url":"https://api.github.com/repos/corda/corda/subscription","commits_url":"https://api.github.com/repos/corda/corda/commits{/sha}","git_commits_url":"https://api.github.com/repos/corda/corda/git/commits{/sha}","comments_url":"https://api.github.com/repos/corda/corda/comments{/number}","issue_comment_url":"https://api.github.com/repos/corda/corda/issues/comments{/number}","contents_url":"https://api.github.com/repos/corda/corda/contents/{+path}","compare_url":"https://api.github.com/repos/corda/corda/compare/{base}...{head}","merges_url":"https://api.github.com/repos/corda/corda/merges","archive_url":"https://api.github.com/repos/corda/corda/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/corda/corda/downloads","issues_url":"https://api.github.com/repos/corda/corda/issues{/number}","pulls_url":"https://api.github.com/repos/corda/corda/pulls{/number}","milestones_url":"https://api.github.com/repos/corda/corda/milestones{/number}","notifications_url":"https://api.github.com/repos/corda/corda/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/corda/corda/labels{/name}","releases_url":"https://api.github.com/repos/corda/corda/releases{/id}","deployments_url":"https://api.github.com/repos/corda/corda/deployments","created_at":"2016-10-06T08:46:29Z","updated_at":"2017-04-18T12:19:50Z","pushed_at":"2017-04-18T15:42:47Z","git_url":"git://github.com/corda/corda.git","ssh_url":"git@github.com:corda/corda.git","clone_url":"https://github.com/corda/corda.git","svn_url":"https://github.com/corda/corda","homepage":"https://www.corda.net","size":70084,"stargazers_count":566,"watchers_count":566,"language":"Kotlin","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":181,"mirror_url":null,"open_issues_count":49,"forks":181,"open_issues":49,"watchers":566,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/corda/corda/pulls/522"},"html":{"href":"https://github.com/corda/corda/pull/522"},"issue":{"href":"https://api.github.com/repos/corda/corda/issues/522"},"comments":{"href":"https://api.github.com/repos/corda/corda/issues/522/comments"},"review_comments":{"href":"https://api.github.com/repos/corda/corda/pulls/522/comments"},"review_comment":{"href":"https://api.github.com/repos/corda/corda/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/corda/corda/pulls/522/commits"},"statuses":{"href":"https://api.github.com/repos/corda/corda/statuses/90437cc3a36bd3210b5968e519eb1894f41f8706"}}}}
{"actor":{"display_login":"rick-r3"}}