-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CORE-17430 Persist reference states into utxo_transaction_sources tab…
…le and align with column changes (#4849) The utxo_transaction_sources table has been modified. See CORE-17430 Modify the utxo_transaction_sources table by removing unused columns and renaming corda-api#1288. This PR contains the changes to align with those DB changes. Reference states were not persisted in utxo_transaction_sources until now. Added that persisting logic.
- Loading branch information
Showing
14 changed files
with
185 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
.../src/main/kotlin/com/example/ledger/testing/datamodel/utxo/UtxoTransactionSourceEntity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
package com.example.ledger.testing.datamodel.utxo | ||
|
||
import net.corda.v5.base.annotations.CordaSerializable | ||
import java.io.Serializable | ||
import javax.persistence.Column | ||
import javax.persistence.Embeddable | ||
import javax.persistence.Entity | ||
import javax.persistence.Id | ||
import javax.persistence.IdClass | ||
import javax.persistence.JoinColumn | ||
import javax.persistence.ManyToOne | ||
import javax.persistence.NamedQuery | ||
import javax.persistence.Table | ||
|
||
@CordaSerializable | ||
@NamedQuery( | ||
name = "UtxoTransactionSourceEntity.findByTransactionId", | ||
query = "from UtxoTransactionSourceEntity where transaction.id = :transactionId" | ||
) | ||
@Entity | ||
@Table(name = "utxo_transaction_sources") | ||
@IdClass(UtxoTransactionSourceEntityId::class) | ||
data class UtxoTransactionSourceEntity( | ||
@get:Id | ||
@get:ManyToOne | ||
@get:JoinColumn(name = "transaction_id", nullable = false, updatable = false) | ||
var transaction: UtxoTransactionEntity, | ||
|
||
@get:Id | ||
@get:Column(name = "group_idx", nullable = false) | ||
var groupIndex: Int, | ||
|
||
@get:Id | ||
@get:Column(name = "leaf_idx", nullable = false) | ||
var leafIndex: Int, | ||
|
||
@get:Column(name = "source_state_transaction_id", nullable = false) | ||
var refTransactionId: String, | ||
|
||
@get:Column(name = "source_state_idx", nullable = false) | ||
var refLeafIndex: Int | ||
) | ||
|
||
@Embeddable | ||
data class UtxoTransactionSourceEntityId( | ||
var transaction: UtxoTransactionEntity, | ||
var groupIndex: Int, | ||
var leafIndex: Int | ||
) : Serializable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters