Vault Query Sort by StateRef (or constituents: txId, index) (#990)

* Provide sorting by state reference (and individual constituents of: txId, index)

* Fixed formatting.

* Updated import following rebase from master.

* Updated import following rebase from master.
This commit is contained in:
josecoll
2017-07-10 12:49:00 +01:00
committed by GitHub
parent f718acb939
commit c81ef7eb93
7 changed files with 200 additions and 29 deletions

View File

@ -150,7 +150,13 @@ data class Sort(val columns: Collection<SortColumn>) {
@CordaSerializable
interface Attribute
enum class VaultStateAttribute(val columnName: String) : Attribute {
enum class CommonStateAttribute(val attributeParent: String, val attributeChild: String?) : Attribute {
STATE_REF("stateRef", null),
STATE_REF_TXN_ID("stateRef", "txId"),
STATE_REF_INDEX("stateRef", "index")
}
enum class VaultStateAttribute(val attributeName: String) : Attribute {
/** Vault States */
NOTARY_NAME("notaryName"),
CONTRACT_TYPE("contractStateClassName"),
@ -160,14 +166,14 @@ data class Sort(val columns: Collection<SortColumn>) {
LOCK_ID("lockId")
}
enum class LinearStateAttribute(val columnName: String) : Attribute {
enum class LinearStateAttribute(val attributeName: String) : Attribute {
/** Vault Linear States */
UUID("uuid"),
EXTERNAL_ID("externalId"),
DEAL_REFERENCE("dealReference")
}
enum class FungibleStateAttribute(val columnName: String) : Attribute {
enum class FungibleStateAttribute(val attributeName: String) : Attribute {
/** Vault Fungible States */
QUANTITY("quantity"),
ISSUER_REF("issuerRef")