remove unused commercial paper samples

This commit is contained in:
Stefano Franz 2019-01-04 15:51:56 +00:00 committed by Stefano Franz
parent e98dbcc2af
commit 119ed61a21
2 changed files with 0 additions and 100 deletions

View File

@ -1,53 +0,0 @@
package net.corda.finance.test
import net.corda.core.contracts.MAX_ISSUER_REF_SIZE
import net.corda.core.schemas.MappedSchema
import net.corda.core.schemas.PersistentState
import net.corda.core.utilities.MAX_HASH_HEX_SIZE
import org.hibernate.annotations.Type
import java.time.Instant
import javax.persistence.Column
import javax.persistence.Entity
import javax.persistence.Index
import javax.persistence.Table
/**
* An object used to fully qualify the [CommercialPaperSchema] family name (i.e. independent of version).
*/
object CommercialPaperSchema
/**
* First version of a commercial paper contract ORM schema that maps all fields of the [CommercialPaper] contract state
* as it stood at the time of writing.
*/
object SampleCommercialPaperSchemaV1 : MappedSchema(schemaFamily = CommercialPaperSchema.javaClass, version = 1, mappedTypes = listOf(PersistentCommercialPaperState::class.java)) {
@Entity
@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, nullable = false)
var issuancePartyHash: String,
@Column(name = "issuance_ref", nullable = false)
@Type(type = "corda-wrapper-binary")
var issuanceRef: ByteArray,
@Column(name = "owner_key_hash", length = MAX_HASH_HEX_SIZE, nullable = false)
var ownerHash: String,
@Column(name = "maturity_instant", nullable = false)
var maturity: Instant,
@Column(name = "face_value", nullable = false)
var faceValue: Long,
@Column(name = "ccy_code", length = 3, nullable = false)
var currency: String,
@Column(name = "face_value_issuer_key_hash", length = MAX_HASH_HEX_SIZE, nullable = false)
var faceValueIssuerPartyHash: String,
@Column(name = "face_value_issuer_ref", length = MAX_ISSUER_REF_SIZE, nullable = false)
@Type(type = "corda-wrapper-binary")
var faceValueIssuerRef: ByteArray
) : PersistentState()
}

View File

@ -1,47 +0,0 @@
package net.corda.finance.test
import net.corda.core.contracts.MAX_ISSUER_REF_SIZE
import net.corda.core.identity.AbstractParty
import net.corda.core.schemas.CommonSchemaV1
import net.corda.core.schemas.MappedSchema
import net.corda.core.utilities.MAX_HASH_HEX_SIZE
import net.corda.core.utilities.OpaqueBytes
import org.hibernate.annotations.Type
import java.time.Instant
import javax.persistence.*
/**
* Second version of a cash contract ORM schema that extends the common
* [VaultFungibleState] abstract schema
*/
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")])
class PersistentCommercialPaperState(
@Column(name = "maturity_instant", nullable = false)
var maturity: Instant,
@Column(name = "ccy_code", length = 3, nullable = false)
var currency: String,
@Column(name = "face_value_issuer_key_hash", length = MAX_HASH_HEX_SIZE, nullable = false)
var faceValueIssuerPartyHash: String,
@Column(name = "face_value_issuer_ref", length = MAX_ISSUER_REF_SIZE, nullable = false)
@Type(type = "corda-wrapper-binary")
var faceValueIssuerRef: ByteArray,
participants: Set<AbstractParty>,
owner: AbstractParty,
quantity: Long,
issuerParty: AbstractParty,
issuerRef: OpaqueBytes
) : CommonSchemaV1.FungibleState(participants.toMutableSet(), owner, quantity, issuerParty, issuerRef.bytes) {
@ElementCollection
@Column(name = "participants")
@CollectionTable(name = "cp_states_v2_participants", joinColumns = [JoinColumn(name = "output_index", referencedColumnName = "output_index"), JoinColumn(name = "transaction_id", referencedColumnName = "transaction_id")])
override var participants: MutableSet<AbstractParty?>? = null
}
}