mirror of
https://github.com/corda/corda.git
synced 2025-01-18 10:46:38 +00:00
[CORDA-1269]: Changed usages of arrayOf()
in Entities to use Kotlin 1.2 style. (#3122)
This commit is contained in:
parent
bb62538d28
commit
ea81548d60
@ -21,9 +21,7 @@ object CashSchema
|
||||
@CordaSerializable
|
||||
object CashSchemaV1 : MappedSchema(schemaFamily = CashSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCashState::class.java)) {
|
||||
@Entity
|
||||
@Table(name = "contract_cash_states",
|
||||
indexes = arrayOf(Index(name = "ccy_code_idx", columnList = "ccy_code"),
|
||||
Index(name = "pennies_idx", columnList = "pennies")))
|
||||
@Table(name = "contract_cash_states", indexes = [Index(name = "ccy_code_idx", columnList = "ccy_code"), Index(name = "pennies_idx", columnList = "pennies")])
|
||||
class PersistentCashState(
|
||||
/** X500Name of owner party **/
|
||||
@Column(name = "owner_name")
|
||||
|
@ -24,10 +24,7 @@ object CommercialPaperSchema
|
||||
@CordaSerializable
|
||||
object CommercialPaperSchemaV1 : MappedSchema(schemaFamily = CommercialPaperSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCommercialPaperState::class.java)) {
|
||||
@Entity
|
||||
@Table(name = "cp_states",
|
||||
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")))
|
||||
@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")])
|
||||
class PersistentCommercialPaperState(
|
||||
@Column(name = "issuance_key_hash", length = MAX_HASH_HEX_SIZE)
|
||||
var issuancePartyHash: String,
|
||||
|
@ -21,9 +21,7 @@ object CashSchema
|
||||
*/
|
||||
object SampleCashSchemaV1 : MappedSchema(schemaFamily = CashSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCashState::class.java)) {
|
||||
@Entity
|
||||
@Table(name = "contract_cash_states",
|
||||
indexes = arrayOf(Index(name = "ccy_code_idx", columnList = "ccy_code"),
|
||||
Index(name = "pennies_idx", columnList = "pennies")))
|
||||
@Table(name = "contract_cash_states", indexes = [Index(name = "ccy_code_idx", columnList = "ccy_code"), Index(name = "pennies_idx", columnList = "pennies")])
|
||||
class PersistentCashState(
|
||||
@Column(name = "owner_key_hash", length = MAX_HASH_HEX_SIZE)
|
||||
var ownerHash: String,
|
||||
|
@ -22,10 +22,7 @@ object CommercialPaperSchema
|
||||
*/
|
||||
object SampleCommercialPaperSchemaV1 : MappedSchema(schemaFamily = CommercialPaperSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCommercialPaperState::class.java)) {
|
||||
@Entity
|
||||
@Table(name = "cp_states",
|
||||
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")))
|
||||
@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")])
|
||||
class PersistentCommercialPaperState(
|
||||
@Column(name = "issuance_key_hash", length = MAX_HASH_HEX_SIZE)
|
||||
var issuancePartyHash: String,
|
||||
|
@ -17,8 +17,7 @@ import javax.persistence.*
|
||||
object SampleCommercialPaperSchemaV2 : MappedSchema(schemaFamily = CommercialPaperSchema.javaClass, version = 1,
|
||||
mappedTypes = listOf(PersistentCommercialPaperState::class.java)) {
|
||||
@Entity
|
||||
@Table(name = "cp_states_v2",
|
||||
indexes = [Index(name = "ccy_code_index2", columnList = "ccy_code"), Index(name = "maturity_index2", columnList = "maturity_instant")])
|
||||
@Table(name = "cp_states_v2", indexes = [Index(name = "ccy_code_index2", columnList = "ccy_code"), Index(name = "maturity_index2", columnList = "maturity_instant")])
|
||||
class PersistentCommercialPaperState(
|
||||
@Column(name = "maturity_instant")
|
||||
var maturity: Instant,
|
||||
|
@ -75,8 +75,7 @@ class NodeAttachmentService(
|
||||
}
|
||||
|
||||
@Entity
|
||||
@Table(name = "${NODE_DATABASE_PREFIX}attachments",
|
||||
indexes = arrayOf(Index(name = "att_id_idx", columnList = "att_id")))
|
||||
@Table(name = "${NODE_DATABASE_PREFIX}attachments", indexes = [Index(name = "att_id_idx", columnList = "att_id")])
|
||||
class DBAttachment(
|
||||
@Id
|
||||
@Column(name = "att_id")
|
||||
|
@ -28,9 +28,7 @@ object VaultSchema
|
||||
object VaultSchemaV1 : MappedSchema(schemaFamily = VaultSchema.javaClass, version = 1,
|
||||
mappedTypes = listOf(VaultStates::class.java, VaultLinearStates::class.java, VaultFungibleStates::class.java, VaultTxnNote::class.java)) {
|
||||
@Entity
|
||||
@Table(name = "vault_states",
|
||||
indexes = arrayOf(Index(name = "state_status_idx", columnList = "state_status"),
|
||||
Index(name = "lock_id_idx", columnList = "lock_id, state_status")))
|
||||
@Table(name = "vault_states", indexes = [Index(name = "state_status_idx", columnList = "state_status"), Index(name = "lock_id_idx", columnList = "lock_id, state_status")])
|
||||
class VaultStates(
|
||||
/** 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)
|
||||
@ -66,9 +64,7 @@ object VaultSchemaV1 : MappedSchema(schemaFamily = VaultSchema.javaClass, versio
|
||||
) : PersistentState()
|
||||
|
||||
@Entity
|
||||
@Table(name = "vault_linear_states",
|
||||
indexes = arrayOf(Index(name = "external_id_index", columnList = "external_id"),
|
||||
Index(name = "uuid_index", columnList = "uuid")))
|
||||
@Table(name = "vault_linear_states", indexes = [Index(name = "external_id_index", columnList = "external_id"), Index(name = "uuid_index", columnList = "uuid")])
|
||||
class VaultLinearStates(
|
||||
/** [ContractState] attributes */
|
||||
|
||||
@ -150,9 +146,7 @@ object VaultSchemaV1 : MappedSchema(schemaFamily = VaultSchema.javaClass, versio
|
||||
}
|
||||
|
||||
@Entity
|
||||
@Table(name = "vault_transaction_notes",
|
||||
indexes = arrayOf(Index(name = "seq_no_index", columnList = "seq_no"),
|
||||
Index(name = "transaction_id_index", columnList = "transaction_id")))
|
||||
@Table(name = "vault_transaction_notes", indexes = [Index(name = "seq_no_index", columnList = "seq_no"), Index(name = "transaction_id_index", columnList = "transaction_id")])
|
||||
class VaultTxnNote(
|
||||
@Id
|
||||
@GeneratedValue
|
||||
|
@ -20,9 +20,7 @@ object DummyLinearStateSchema
|
||||
*/
|
||||
object DummyLinearStateSchemaV1 : MappedSchema(schemaFamily = DummyLinearStateSchema.javaClass, version = 1, mappedTypes = listOf(PersistentDummyLinearState::class.java)) {
|
||||
@Entity
|
||||
@Table(name = "dummy_linear_states",
|
||||
indexes = arrayOf(Index(name = "external_id_idx", columnList = "external_id"),
|
||||
Index(name = "uuid_idx", columnList = "uuid")))
|
||||
@Table(name = "dummy_linear_states", indexes = [Index(name = "external_id_idx", columnList = "external_id"), Index(name = "uuid_idx", columnList = "uuid")])
|
||||
class PersistentDummyLinearState(
|
||||
/** [ContractState] attributes */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user