我遵循cordapp示例代码并创建了IOU。 任何人都可以让我知道我在哪里可以看到它的H2数据库的主键? 我如何更新以拥有复合键?
I am following the cordapp example code and created IOUs. Can anyone please let me know where can I see the primary key of its H2 database ? How Can I update to have a composite key ?
最满意答案
IOUState的数据库模式在IOUState定义: https : //github.com/corda/cordapp-example/blob/release-V3/kotlin-source/src/main/kotlin/com/example/schema/IOUSchema.kt 。
所有状态模式都必须继承PersistentState 。 PersistentState将状态表的主键设置为PersistentStateRef实例的组合键。 PersistentStateRef结合了:
生成状态的事务的散列 该州的交易产出指数从Corda 3开始,您不能将状态表更改为使用不同的主键。
The database schema for IOUState is defined here: https://github.com/corda/cordapp-example/blob/release-V3/kotlin-source/src/main/kotlin/com/example/schema/IOUSchema.kt.
All state schemas must subclass PersistentState. PersistentState sets the state table's primary key to a composite key which is an instance of PersistentStateRef. PersistentStateRef combines:
The hash of the transaction that generated the state The state's index in the outputs of that transactionAs of Corda 3, you cannot change the state's table to use a different primary key.
更多推荐
发布评论