mirror of
https://github.com/corda/corda.git
synced 2025-06-16 22:28:15 +00:00
Moved dummy stuff from core into test-utils
This commit is contained in:
@ -1,25 +0,0 @@
|
||||
package net.corda.core.schemas.testing
|
||||
|
||||
/**
|
||||
* An object used to fully qualify the [DummyDealStateSchema] family name (i.e. independent of version).
|
||||
*/
|
||||
object DummyDealStateSchema
|
||||
|
||||
/**
|
||||
* First version of a cash contract ORM schema that maps all fields of the [DummyDealState] contract state as it stood
|
||||
* at the time of writing.
|
||||
*/
|
||||
object DummyDealStateSchemaV1 : net.corda.core.schemas.MappedSchema(schemaFamily = net.corda.core.schemas.testing.DummyDealStateSchema.javaClass, version = 1, mappedTypes = listOf(net.corda.core.schemas.testing.DummyDealStateSchemaV1.PersistentDummyDealState::class.java)) {
|
||||
@javax.persistence.Entity
|
||||
@javax.persistence.Table(name = "dummy_deal_states")
|
||||
class PersistentDummyDealState(
|
||||
|
||||
@javax.persistence.Column(name = "deal_reference")
|
||||
var dealReference: String,
|
||||
|
||||
/** parent attributes */
|
||||
@javax.persistence.Transient
|
||||
val uid: net.corda.core.contracts.UniqueIdentifier
|
||||
|
||||
) : net.corda.node.services.vault.schemas.jpa.CommonSchemaV1.LinearState(uid = uid)
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
package net.corda.core.schemas.testing
|
||||
|
||||
import net.corda.core.schemas.MappedSchema
|
||||
import net.corda.core.schemas.PersistentState
|
||||
import java.time.Instant
|
||||
import java.util.*
|
||||
import javax.persistence.Column
|
||||
import javax.persistence.Entity
|
||||
import javax.persistence.Index
|
||||
import javax.persistence.Table
|
||||
|
||||
/**
|
||||
* An object used to fully qualify the [DummyLinearStateSchema] family name (i.e. independent of version).
|
||||
*/
|
||||
object DummyLinearStateSchema
|
||||
|
||||
/**
|
||||
* First version of a cash contract ORM schema that maps all fields of the [DummyLinearState] contract state as it stood
|
||||
* at the time of writing.
|
||||
*/
|
||||
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")))
|
||||
class PersistentDummyLinearState(
|
||||
/**
|
||||
* UniqueIdentifier
|
||||
*/
|
||||
@Column(name = "external_id")
|
||||
var externalId: String?,
|
||||
|
||||
@Column(name = "uuid", nullable = false)
|
||||
var uuid: UUID,
|
||||
|
||||
/**
|
||||
* Dummy attributes
|
||||
*/
|
||||
@Column(name = "linear_string")
|
||||
var linearString: String,
|
||||
|
||||
@Column(name = "linear_number")
|
||||
var linearNumber: Long,
|
||||
|
||||
@Column(name = "linear_timestamp")
|
||||
var linearTimestamp: Instant,
|
||||
|
||||
@Column(name = "linear_boolean")
|
||||
var linearBoolean: Boolean
|
||||
) : PersistentState()
|
||||
}
|
@ -1,24 +0,0 @@
|
||||
package net.corda.core.schemas.testing
|
||||
|
||||
/**
|
||||
* Second version of a cash contract ORM schema that extends the common
|
||||
* [VaultLinearState] abstract schema
|
||||
*/
|
||||
object DummyLinearStateSchemaV2 : net.corda.core.schemas.MappedSchema(schemaFamily = DummyLinearStateSchema.javaClass, version = 2,
|
||||
mappedTypes = listOf(net.corda.core.schemas.testing.DummyLinearStateSchemaV2.PersistentDummyLinearState::class.java)) {
|
||||
@javax.persistence.Entity
|
||||
@javax.persistence.Table(name = "dummy_linear_states_v2")
|
||||
class PersistentDummyLinearState(
|
||||
@javax.persistence.Column(name = "linear_string") var linearString: String,
|
||||
|
||||
@javax.persistence.Column(name = "linear_number") var linearNumber: Long,
|
||||
|
||||
@javax.persistence.Column(name = "linear_timestamp") var linearTimestamp: java.time.Instant,
|
||||
|
||||
@javax.persistence.Column(name = "linear_boolean") var linearBoolean: Boolean,
|
||||
|
||||
/** parent attributes */
|
||||
@Transient
|
||||
val uid: net.corda.core.contracts.UniqueIdentifier
|
||||
) : net.corda.node.services.vault.schemas.jpa.CommonSchemaV1.LinearState(uid = uid)
|
||||
}
|
Reference in New Issue
Block a user