[CORDA-1269]: Changed usages of arrayOf() in Entities to use Kotlin 1.2 style. (#3122)

This commit is contained in:
Michele Sollecito 2018-05-11 21:07:53 +07:00 committed by GitHub
parent bb62538d28
commit ea81548d60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 10 additions and 30 deletions

View File

@ -21,9 +21,7 @@ object CashSchema
@CordaSerializable @CordaSerializable
object CashSchemaV1 : MappedSchema(schemaFamily = CashSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCashState::class.java)) { object CashSchemaV1 : MappedSchema(schemaFamily = CashSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCashState::class.java)) {
@Entity @Entity
@Table(name = "contract_cash_states", @Table(name = "contract_cash_states", indexes = [Index(name = "ccy_code_idx", columnList = "ccy_code"), Index(name = "pennies_idx", columnList = "pennies")])
indexes = arrayOf(Index(name = "ccy_code_idx", columnList = "ccy_code"),
Index(name = "pennies_idx", columnList = "pennies")))
class PersistentCashState( class PersistentCashState(
/** X500Name of owner party **/ /** X500Name of owner party **/
@Column(name = "owner_name") @Column(name = "owner_name")

View File

@ -24,10 +24,7 @@ object CommercialPaperSchema
@CordaSerializable @CordaSerializable
object CommercialPaperSchemaV1 : MappedSchema(schemaFamily = CommercialPaperSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCommercialPaperState::class.java)) { object CommercialPaperSchemaV1 : MappedSchema(schemaFamily = CommercialPaperSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCommercialPaperState::class.java)) {
@Entity @Entity
@Table(name = "cp_states", @Table(name = "cp_states", indexes = [Index(name = "ccy_code_index", columnList = "ccy_code"), Index(name = "maturity_index", columnList = "maturity_instant"), Index(name = "face_value_index", columnList = "face_value")])
indexes = arrayOf(Index(name = "ccy_code_index", columnList = "ccy_code"),
Index(name = "maturity_index", columnList = "maturity_instant"),
Index(name = "face_value_index", columnList = "face_value")))
class PersistentCommercialPaperState( class PersistentCommercialPaperState(
@Column(name = "issuance_key_hash", length = MAX_HASH_HEX_SIZE) @Column(name = "issuance_key_hash", length = MAX_HASH_HEX_SIZE)
var issuancePartyHash: String, var issuancePartyHash: String,

View File

@ -21,9 +21,7 @@ object CashSchema
*/ */
object SampleCashSchemaV1 : MappedSchema(schemaFamily = CashSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCashState::class.java)) { object SampleCashSchemaV1 : MappedSchema(schemaFamily = CashSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCashState::class.java)) {
@Entity @Entity
@Table(name = "contract_cash_states", @Table(name = "contract_cash_states", indexes = [Index(name = "ccy_code_idx", columnList = "ccy_code"), Index(name = "pennies_idx", columnList = "pennies")])
indexes = arrayOf(Index(name = "ccy_code_idx", columnList = "ccy_code"),
Index(name = "pennies_idx", columnList = "pennies")))
class PersistentCashState( class PersistentCashState(
@Column(name = "owner_key_hash", length = MAX_HASH_HEX_SIZE) @Column(name = "owner_key_hash", length = MAX_HASH_HEX_SIZE)
var ownerHash: String, var ownerHash: String,

View File

@ -22,10 +22,7 @@ object CommercialPaperSchema
*/ */
object SampleCommercialPaperSchemaV1 : MappedSchema(schemaFamily = CommercialPaperSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCommercialPaperState::class.java)) { object SampleCommercialPaperSchemaV1 : MappedSchema(schemaFamily = CommercialPaperSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCommercialPaperState::class.java)) {
@Entity @Entity
@Table(name = "cp_states", @Table(name = "cp_states", indexes = [Index(name = "ccy_code_index", columnList = "ccy_code"), Index(name = "maturity_index", columnList = "maturity_instant"), Index(name = "face_value_index", columnList = "face_value")])
indexes = arrayOf(Index(name = "ccy_code_index", columnList = "ccy_code"),
Index(name = "maturity_index", columnList = "maturity_instant"),
Index(name = "face_value_index", columnList = "face_value")))
class PersistentCommercialPaperState( class PersistentCommercialPaperState(
@Column(name = "issuance_key_hash", length = MAX_HASH_HEX_SIZE) @Column(name = "issuance_key_hash", length = MAX_HASH_HEX_SIZE)
var issuancePartyHash: String, var issuancePartyHash: String,

View File

@ -17,8 +17,7 @@ import javax.persistence.*
object SampleCommercialPaperSchemaV2 : MappedSchema(schemaFamily = CommercialPaperSchema.javaClass, version = 1, object SampleCommercialPaperSchemaV2 : MappedSchema(schemaFamily = CommercialPaperSchema.javaClass, version = 1,
mappedTypes = listOf(PersistentCommercialPaperState::class.java)) { mappedTypes = listOf(PersistentCommercialPaperState::class.java)) {
@Entity @Entity
@Table(name = "cp_states_v2", @Table(name = "cp_states_v2", indexes = [Index(name = "ccy_code_index2", columnList = "ccy_code"), Index(name = "maturity_index2", columnList = "maturity_instant")])
indexes = [Index(name = "ccy_code_index2", columnList = "ccy_code"), Index(name = "maturity_index2", columnList = "maturity_instant")])
class PersistentCommercialPaperState( class PersistentCommercialPaperState(
@Column(name = "maturity_instant") @Column(name = "maturity_instant")
var maturity: Instant, var maturity: Instant,

View File

@ -75,8 +75,7 @@ class NodeAttachmentService(
} }
@Entity @Entity
@Table(name = "${NODE_DATABASE_PREFIX}attachments", @Table(name = "${NODE_DATABASE_PREFIX}attachments", indexes = [Index(name = "att_id_idx", columnList = "att_id")])
indexes = arrayOf(Index(name = "att_id_idx", columnList = "att_id")))
class DBAttachment( class DBAttachment(
@Id @Id
@Column(name = "att_id") @Column(name = "att_id")

View File

@ -28,9 +28,7 @@ object VaultSchema
object VaultSchemaV1 : MappedSchema(schemaFamily = VaultSchema.javaClass, version = 1, object VaultSchemaV1 : MappedSchema(schemaFamily = VaultSchema.javaClass, version = 1,
mappedTypes = listOf(VaultStates::class.java, VaultLinearStates::class.java, VaultFungibleStates::class.java, VaultTxnNote::class.java)) { mappedTypes = listOf(VaultStates::class.java, VaultLinearStates::class.java, VaultFungibleStates::class.java, VaultTxnNote::class.java)) {
@Entity @Entity
@Table(name = "vault_states", @Table(name = "vault_states", indexes = [Index(name = "state_status_idx", columnList = "state_status"), Index(name = "lock_id_idx", columnList = "lock_id, state_status")])
indexes = arrayOf(Index(name = "state_status_idx", columnList = "state_status"),
Index(name = "lock_id_idx", columnList = "lock_id, state_status")))
class VaultStates( class VaultStates(
/** NOTE: serialized transaction state (including contract state) is now resolved from transaction store */ /** NOTE: serialized transaction state (including contract state) is now resolved from transaction store */
// TODO: create a distinct table to hold serialized state data (once DBTransactionStore is encrypted) // TODO: create a distinct table to hold serialized state data (once DBTransactionStore is encrypted)
@ -66,9 +64,7 @@ object VaultSchemaV1 : MappedSchema(schemaFamily = VaultSchema.javaClass, versio
) : PersistentState() ) : PersistentState()
@Entity @Entity
@Table(name = "vault_linear_states", @Table(name = "vault_linear_states", indexes = [Index(name = "external_id_index", columnList = "external_id"), Index(name = "uuid_index", columnList = "uuid")])
indexes = arrayOf(Index(name = "external_id_index", columnList = "external_id"),
Index(name = "uuid_index", columnList = "uuid")))
class VaultLinearStates( class VaultLinearStates(
/** [ContractState] attributes */ /** [ContractState] attributes */
@ -150,9 +146,7 @@ object VaultSchemaV1 : MappedSchema(schemaFamily = VaultSchema.javaClass, versio
} }
@Entity @Entity
@Table(name = "vault_transaction_notes", @Table(name = "vault_transaction_notes", indexes = [Index(name = "seq_no_index", columnList = "seq_no"), Index(name = "transaction_id_index", columnList = "transaction_id")])
indexes = arrayOf(Index(name = "seq_no_index", columnList = "seq_no"),
Index(name = "transaction_id_index", columnList = "transaction_id")))
class VaultTxnNote( class VaultTxnNote(
@Id @Id
@GeneratedValue @GeneratedValue

View File

@ -20,9 +20,7 @@ object DummyLinearStateSchema
*/ */
object DummyLinearStateSchemaV1 : MappedSchema(schemaFamily = DummyLinearStateSchema.javaClass, version = 1, mappedTypes = listOf(PersistentDummyLinearState::class.java)) { object DummyLinearStateSchemaV1 : MappedSchema(schemaFamily = DummyLinearStateSchema.javaClass, version = 1, mappedTypes = listOf(PersistentDummyLinearState::class.java)) {
@Entity @Entity
@Table(name = "dummy_linear_states", @Table(name = "dummy_linear_states", indexes = [Index(name = "external_id_idx", columnList = "external_id"), Index(name = "uuid_idx", columnList = "uuid")])
indexes = arrayOf(Index(name = "external_id_idx", columnList = "external_id"),
Index(name = "uuid_idx", columnList = "uuid")))
class PersistentDummyLinearState( class PersistentDummyLinearState(
/** [ContractState] attributes */ /** [ContractState] attributes */