根据最新文档here for the actual transformation
我找不到如何映射java集合,如List,Set .. 是否可以将Set存储到架构? 谢谢。
答案 0 :(得分:1)
在这里SampleCashSchemaV3.kt
查看MutableSet<AbstractParty>?
。
在此架构中,参与者列表存储为object SampleCashSchemaV3 : MappedSchema(schemaFamily = CashSchema.javaClass, version = 3,
mappedTypes = listOf(PersistentCashState::class.java)) {
@Entity
@Table(name = "cash_states_v3")
class PersistentCashState(
/** [ContractState] attributes */
/** X500Name of participant parties **/
@ElementCollection
var participants: MutableSet<AbstractParty>? = null,
/** X500Name of owner party **/
@Column(name = "owner_name")
var owner: AbstractParty,
@Column(name = "pennies")
var pennies: Long,
@Column(name = "ccy_code", length = 3)
var currency: String,
/** X500Name of issuer party **/
@Column(name = "issuer_name")
var issuer: AbstractParty,
@Column(name = "issuer_ref", length = MAX_ISSUER_REF_SIZE)
@Type(type = "corda-wrapper-binary")
var issuerRef: ByteArray
) : PersistentState()
}
:
Grafo