diff --git a/.ci/api-current.txt b/.ci/api-current.txt index ec11b37730..a1a4e27e36 100644 --- a/.ci/api-current.txt +++ b/.ci/api-current.txt @@ -4359,7 +4359,7 @@ public interface net.corda.core.schemas.QueryableState extends net.corda.core.co @NotNull public abstract Iterable supportedSchemas() ## -public interface net.corda.core.schemas.StatePersistable extends java.io.Serializable +public interface net.corda.core.schemas.StatePersistable ## public interface net.corda.core.serialization.ClassWhitelist public abstract boolean hasListed(Class) diff --git a/core-deterministic/build.gradle b/core-deterministic/build.gradle index 5768501551..68edeba73c 100644 --- a/core-deterministic/build.gradle +++ b/core-deterministic/build.gradle @@ -74,7 +74,7 @@ task predeterminise(type: ProGuardTask) { keepattributes '*' keepdirectories - dontwarn '**$1$1' + dontwarn '**$1$1,org.hibernate.annotations.*' dontpreverify dontobfuscate dontoptimize @@ -100,7 +100,8 @@ task jarFilter(type: JarFilterTask) { "net.corda.core.StubOutForDJVM" ] forRemove = [ - "co.paralleluniverse.fibers.Suspendable" + "co.paralleluniverse.fibers.Suspendable", + "org.hibernate.annotations.Immutable" ] } } diff --git a/core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt b/core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt index a4f7391f40..838e1bfe0e 100644 --- a/core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt +++ b/core/src/main/kotlin/net/corda/core/schemas/PersistentTypes.kt @@ -5,6 +5,7 @@ import net.corda.core.contracts.ContractState import net.corda.core.contracts.StateRef import net.corda.core.serialization.CordaSerializable import net.corda.core.utilities.toHexString +import org.hibernate.annotations.Immutable import java.io.Serializable import javax.persistence.Column import javax.persistence.Embeddable @@ -82,6 +83,7 @@ class PersistentState(@EmbeddedId var stateRef: PersistentStateRef? = null) : St */ @KeepForDJVM @Embeddable +@Immutable data class PersistentStateRef( @Column(name = "transaction_id", length = 64, nullable = false) var txId: String, @@ -96,7 +98,8 @@ data class PersistentStateRef( * Marker interface to denote a persistable Corda state entity that will always have a transaction id and index */ @KeepForDJVM -interface StatePersistable : Serializable +interface StatePersistable + object MappedSchemaValidator { fun fieldsFromOtherMappedSchema(schema: MappedSchema) : List = schema.mappedTypes.map { entity -> diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst index 9bb8267023..95ed758c45 100644 --- a/docs/source/changelog.rst +++ b/docs/source/changelog.rst @@ -6,6 +6,9 @@ release, see :doc:`upgrade-notes`. Unreleased ---------- +* The Corda JPA entities no longer implement java.io.Serializable, as this was causing persistence errors in obscure cases. + Java serialization is disabled globally in the node, but in the unlikely event you were relying on these types being Java serializable please contact us. + * Remove all references to the out-of-process transaction verification. * The class carpenter has a "lenient" mode where it will, during deserialisation, happily synthesis classes that implement diff --git a/node/src/main/kotlin/net/corda/node/internal/schemas/NodeInfoSchema.kt b/node/src/main/kotlin/net/corda/node/internal/schemas/NodeInfoSchema.kt index 53fbf54a64..69332d0e69 100644 --- a/node/src/main/kotlin/net/corda/node/internal/schemas/NodeInfoSchema.kt +++ b/node/src/main/kotlin/net/corda/node/internal/schemas/NodeInfoSchema.kt @@ -10,7 +10,6 @@ import net.corda.core.serialization.serialize import net.corda.core.utilities.MAX_HASH_HEX_SIZE import net.corda.core.utilities.NetworkHostAndPort import net.corda.node.services.persistence.NodePropertiesPersistentStore -import java.io.Serializable import javax.persistence.* object NodeInfoSchema @@ -53,7 +52,7 @@ object NodeInfoSchemaV1 : MappedSchema( */ @Column(name = "serial", nullable = false) val serial: Long - ) : Serializable { + ) { fun toNodeInfo(): NodeInfo { return NodeInfo( this.addresses.map { it.toHostAndPort() }, @@ -73,7 +72,7 @@ object NodeInfoSchemaV1 : MappedSchema( var id: Int, val host: String? = null, val port: Int? = null - ) : Serializable { + ) { companion object { fun fromHostAndPort(hostAndPort: NetworkHostAndPort) = DBHostAndPort( 0, hostAndPort.host, hostAndPort.port @@ -106,7 +105,7 @@ object NodeInfoSchemaV1 : MappedSchema( @ManyToMany(mappedBy = "legalIdentitiesAndCerts", cascade = [(CascadeType.ALL)]) // ManyToMany because of distributed services. private val persistentNodeInfos: Set = emptySet() - ) : Serializable { + ) { constructor(partyAndCert: PartyAndCertificate, isMain: Boolean = false) : this(partyAndCert.name.toString(), partyAndCert.party.owningKey.toStringShort(), diff --git a/node/src/main/kotlin/net/corda/node/services/events/NodeSchedulerService.kt b/node/src/main/kotlin/net/corda/node/services/events/NodeSchedulerService.kt index 28ab8fd2ca..01f34cce41 100644 --- a/node/src/main/kotlin/net/corda/node/services/events/NodeSchedulerService.kt +++ b/node/src/main/kotlin/net/corda/node/services/events/NodeSchedulerService.kt @@ -11,13 +11,9 @@ import net.corda.core.contracts.ScheduledStateRef import net.corda.core.contracts.StateRef import net.corda.core.flows.FlowLogic import net.corda.core.flows.FlowLogicRefFactory -import net.corda.core.internal.FlowStateMachine -import net.corda.core.internal.ThreadBox -import net.corda.core.internal.VisibleForTesting +import net.corda.core.internal.* import net.corda.core.internal.concurrent.flatMap import net.corda.core.internal.concurrent.openFuture -import net.corda.core.internal.join -import net.corda.core.internal.until import net.corda.core.node.ServicesForResolution import net.corda.core.schemas.PersistentStateRef import net.corda.core.serialization.SingletonSerializeAsToken @@ -37,18 +33,9 @@ import net.corda.nodeapi.internal.persistence.contextTransaction import org.apache.activemq.artemis.utils.ReusableLatch import org.apache.mina.util.ConcurrentHashSet import org.slf4j.Logger -import java.io.Serializable import java.time.Duration import java.time.Instant -import java.util.concurrent.CancellationException -import java.util.concurrent.CompletableFuture -import java.util.concurrent.CompletionStage -import java.util.concurrent.ExecutionException -import java.util.concurrent.Executor -import java.util.concurrent.Executors -import java.util.concurrent.Future -import java.util.concurrent.TimeUnit -import java.util.concurrent.TimeoutException +import java.util.concurrent.* import javax.annotation.concurrent.ThreadSafe import javax.persistence.Column import javax.persistence.EmbeddedId @@ -149,7 +136,7 @@ class NodeSchedulerService(private val clock: CordaClock, @Column(name = "scheduled_at", nullable = false) var scheduledAt: Instant = Instant.now() - ) : Serializable + ) private class InnerState { var rescheduled: GuavaSettableFuture? = null diff --git a/node/src/main/kotlin/net/corda/node/services/identity/PersistentIdentityService.kt b/node/src/main/kotlin/net/corda/node/services/identity/PersistentIdentityService.kt index 9f080c4b42..59a37b21fc 100644 --- a/node/src/main/kotlin/net/corda/node/services/identity/PersistentIdentityService.kt +++ b/node/src/main/kotlin/net/corda/node/services/identity/PersistentIdentityService.kt @@ -19,7 +19,6 @@ import net.corda.nodeapi.internal.crypto.x509Certificates import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.NODE_DATABASE_PREFIX import org.apache.commons.lang.ArrayUtils.EMPTY_BYTE_ARRAY -import java.io.Serializable import java.security.InvalidAlgorithmParameterException import java.security.PublicKey import java.security.cert.* @@ -86,7 +85,7 @@ class PersistentIdentityService(override val trustRoot: X509Certificate, @Lob @Column(name = "identity_value", nullable = false) var identity: ByteArray = EMPTY_BYTE_ARRAY - ) : Serializable + ) @Entity @javax.persistence.Table(name = "${NODE_DATABASE_PREFIX}named_identities") @@ -97,7 +96,7 @@ class PersistentIdentityService(override val trustRoot: X509Certificate, @Column(name = "pk_hash", length = MAX_HASH_HEX_SIZE, nullable = true) var publicKeyHash: String? = "" - ) : Serializable + ) override val caCertStore: CertStore override val trustAnchor: TrustAnchor = TrustAnchor(trustRoot, null) diff --git a/node/src/main/kotlin/net/corda/node/services/keys/PersistentKeyManagementService.kt b/node/src/main/kotlin/net/corda/node/services/keys/PersistentKeyManagementService.kt index c6d0aaaa86..1f83eef90e 100644 --- a/node/src/main/kotlin/net/corda/node/services/keys/PersistentKeyManagementService.kt +++ b/node/src/main/kotlin/net/corda/node/services/keys/PersistentKeyManagementService.kt @@ -11,7 +11,6 @@ import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.NODE_DATABASE_PREFIX import org.apache.commons.lang.ArrayUtils.EMPTY_BYTE_ARRAY import org.bouncycastle.operator.ContentSigner -import java.io.Serializable import java.security.KeyPair import java.security.PrivateKey import java.security.PublicKey @@ -45,7 +44,7 @@ class PersistentKeyManagementService(val identityService: IdentityService, @Lob @Column(name = "private_key", nullable = false) var privateKey: ByteArray = EMPTY_BYTE_ARRAY - ) : Serializable { + ) { constructor(publicKey: PublicKey, privateKey: PrivateKey) : this(publicKey.toStringShort(), publicKey.encoded, privateKey.encoded) } diff --git a/node/src/main/kotlin/net/corda/node/services/messaging/P2PMessageDeduplicator.kt b/node/src/main/kotlin/net/corda/node/services/messaging/P2PMessageDeduplicator.kt index 4ffe2f660c..ddcb02a80d 100644 --- a/node/src/main/kotlin/net/corda/node/services/messaging/P2PMessageDeduplicator.kt +++ b/node/src/main/kotlin/net/corda/node/services/messaging/P2PMessageDeduplicator.kt @@ -6,7 +6,6 @@ import net.corda.node.services.statemachine.DeduplicationId import net.corda.node.utilities.AppendOnlyPersistentMap import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.NODE_DATABASE_PREFIX -import java.io.Serializable import java.time.Instant import java.util.concurrent.ConcurrentHashMap import javax.persistence.Column @@ -97,7 +96,7 @@ class P2PMessageDeduplicator(private val database: CordaPersistence) { @Column(name = "sequence_number", nullable = true) var seqNo: Long? = null - ) : Serializable + ) private data class MessageMeta(val insertionTime: Instant, val senderHash: String?, val senderSeqNo: Long?) diff --git a/node/src/main/kotlin/net/corda/node/services/persistence/DBCheckpointStorage.kt b/node/src/main/kotlin/net/corda/node/services/persistence/DBCheckpointStorage.kt index 91385d481c..9750f7cc5c 100644 --- a/node/src/main/kotlin/net/corda/node/services/persistence/DBCheckpointStorage.kt +++ b/node/src/main/kotlin/net/corda/node/services/persistence/DBCheckpointStorage.kt @@ -10,7 +10,6 @@ import net.corda.nodeapi.internal.persistence.currentDBSession import org.apache.commons.lang.ArrayUtils.EMPTY_BYTE_ARRAY import org.slf4j.Logger import org.slf4j.LoggerFactory -import java.io.Serializable import java.util.* import java.util.stream.Stream import javax.persistence.Column @@ -34,7 +33,7 @@ class DBCheckpointStorage : CheckpointStorage { @Lob @Column(name = "checkpoint_value", nullable = false) var checkpoint: ByteArray = EMPTY_BYTE_ARRAY - ) : Serializable + ) override fun addCheckpoint(id: StateMachineRunId, checkpoint: SerializedBytes) { currentDBSession().saveOrUpdate(DBCheckpoint().apply { diff --git a/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionMappingStorage.kt b/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionMappingStorage.kt index 467e711c98..3073735e82 100644 --- a/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionMappingStorage.kt +++ b/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionMappingStorage.kt @@ -1,21 +1,22 @@ package net.corda.node.services.persistence -import net.corda.core.internal.bufferUntilSubscribed import net.corda.core.crypto.SecureHash import net.corda.core.flows.StateMachineRunId +import net.corda.core.internal.bufferUntilSubscribed import net.corda.core.messaging.DataFeed import net.corda.core.messaging.StateMachineTransactionMapping import net.corda.node.services.api.StateMachineRecordedTransactionMappingStorage -import net.corda.node.utilities.* +import net.corda.node.utilities.AppendOnlyPersistentMap import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.NODE_DATABASE_PREFIX import net.corda.nodeapi.internal.persistence.bufferUntilDatabaseCommit import net.corda.nodeapi.internal.persistence.wrapWithDatabaseTransaction import rx.subjects.PublishSubject -import java.io.Serializable import java.util.* import javax.annotation.concurrent.ThreadSafe -import javax.persistence.* +import javax.persistence.Column +import javax.persistence.Entity +import javax.persistence.Id /** * Database storage of a txhash -> state machine id mapping. @@ -35,7 +36,7 @@ class DBTransactionMappingStorage(private val database: CordaPersistence) : Stat @Column(name = "state_machine_run_id", length = 36, nullable = true) var stateMachineRunId: String? = "" - ) : Serializable + ) private companion object { fun createMap(): AppendOnlyPersistentMap { diff --git a/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt b/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt index 280d29bb5b..239ab70fab 100644 --- a/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt +++ b/node/src/main/kotlin/net/corda/node/services/persistence/DBTransactionStorage.kt @@ -8,11 +8,7 @@ import net.corda.core.internal.VisibleForTesting import net.corda.core.internal.bufferUntilSubscribed import net.corda.core.internal.concurrent.doneFuture import net.corda.core.messaging.DataFeed -import net.corda.core.serialization.SerializationDefaults -import net.corda.core.serialization.SerializedBytes -import net.corda.core.serialization.SingletonSerializeAsToken -import net.corda.core.serialization.deserialize -import net.corda.core.serialization.serialize +import net.corda.core.serialization.* import net.corda.core.toFuture import net.corda.core.transactions.CoreTransaction import net.corda.core.transactions.SignedTransaction @@ -26,12 +22,7 @@ import net.corda.nodeapi.internal.persistence.wrapWithDatabaseTransaction import org.apache.commons.lang.ArrayUtils.EMPTY_BYTE_ARRAY import rx.Observable import rx.subjects.PublishSubject -import java.io.Serializable -import javax.persistence.Column -import javax.persistence.Entity -import javax.persistence.Id -import javax.persistence.Lob -import javax.persistence.Table +import javax.persistence.* // cache value type to just store the immutable bits of a signed transaction plus conversion helpers typealias TxCacheValue = Pair, List> @@ -51,7 +42,7 @@ class DBTransactionStorage(cacheSizeBytes: Long, private val database: CordaPers @Lob @Column(name = "transaction_value", nullable = false) var transaction: ByteArray = EMPTY_BYTE_ARRAY - ) : Serializable + ) private companion object { fun createTransactionsMap(maxSizeInBytes: Long) diff --git a/node/src/main/kotlin/net/corda/node/services/persistence/NodeAttachmentService.kt b/node/src/main/kotlin/net/corda/node/services/persistence/NodeAttachmentService.kt index 7ecd6b0995..0a7034d67b 100644 --- a/node/src/main/kotlin/net/corda/node/services/persistence/NodeAttachmentService.kt +++ b/node/src/main/kotlin/net/corda/node/services/persistence/NodeAttachmentService.kt @@ -20,11 +20,7 @@ import net.corda.core.node.services.AttachmentId import net.corda.core.node.services.AttachmentStorage import net.corda.core.node.services.vault.AttachmentQueryCriteria import net.corda.core.node.services.vault.AttachmentSort -import net.corda.core.serialization.CordaSerializable -import net.corda.core.serialization.SerializationToken -import net.corda.core.serialization.SerializeAsToken -import net.corda.core.serialization.SerializeAsTokenContext -import net.corda.core.serialization.SingletonSerializeAsToken +import net.corda.core.serialization.* import net.corda.core.utilities.contextLogger import net.corda.node.services.config.NodeConfiguration import net.corda.node.services.vault.HibernateAttachmentQueryCriteriaParser @@ -38,22 +34,12 @@ import net.corda.nodeapi.internal.withContractsInJar import java.io.FilterInputStream import java.io.IOException import java.io.InputStream -import java.io.Serializable import java.nio.file.Paths import java.time.Instant import java.util.* import java.util.jar.JarInputStream import javax.annotation.concurrent.ThreadSafe -import javax.persistence.CollectionTable -import javax.persistence.Column -import javax.persistence.ElementCollection -import javax.persistence.Entity -import javax.persistence.ForeignKey -import javax.persistence.Id -import javax.persistence.Index -import javax.persistence.JoinColumn -import javax.persistence.Lob -import javax.persistence.Table +import javax.persistence.* /** * Stores attachments using Hibernate to database. @@ -115,7 +101,7 @@ class NodeAttachmentService( @CollectionTable(name = "${NODE_DATABASE_PREFIX}attachments_contracts", joinColumns = [(JoinColumn(name = "att_id", referencedColumnName = "att_id"))], foreignKey = ForeignKey(name = "FK__ctr_class__attachments")) var contractClassNames: List? = null - ) : Serializable + ) @VisibleForTesting var checkAttachmentsOnLoad = true diff --git a/node/src/main/kotlin/net/corda/node/services/persistence/NodePropertiesPersistentStore.kt b/node/src/main/kotlin/net/corda/node/services/persistence/NodePropertiesPersistentStore.kt index 89039b5706..e91ff57ea0 100644 --- a/node/src/main/kotlin/net/corda/node/services/persistence/NodePropertiesPersistentStore.kt +++ b/node/src/main/kotlin/net/corda/node/services/persistence/NodePropertiesPersistentStore.kt @@ -9,7 +9,6 @@ import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.NODE_DATABASE_PREFIX import org.slf4j.Logger import rx.subjects.PublishSubject -import java.io.Serializable import javax.persistence.Column import javax.persistence.Entity import javax.persistence.Id @@ -35,7 +34,7 @@ class NodePropertiesPersistentStore(readPhysicalNodeId: () -> String, persistenc @Column(name = "property_value", nullable = true) var value: String? = "" - ) : Serializable + ) } private class FlowsDrainingModeOperationsImpl(readPhysicalNodeId: () -> String, private val persistence: CordaPersistence, logger: Logger) : FlowsDrainingModeOperations { diff --git a/node/src/main/kotlin/net/corda/node/services/transactions/PersistentUniquenessProvider.kt b/node/src/main/kotlin/net/corda/node/services/transactions/PersistentUniquenessProvider.kt index 77d17a1faf..cc532278b7 100644 --- a/node/src/main/kotlin/net/corda/node/services/transactions/PersistentUniquenessProvider.kt +++ b/node/src/main/kotlin/net/corda/node/services/transactions/PersistentUniquenessProvider.kt @@ -22,7 +22,6 @@ import net.corda.core.utilities.debug import net.corda.node.utilities.AppendOnlyPersistentMap import net.corda.nodeapi.internal.persistence.NODE_DATABASE_PREFIX import net.corda.nodeapi.internal.persistence.currentDBSession -import java.io.Serializable import java.time.Clock import java.time.Instant import java.util.* @@ -39,7 +38,7 @@ class PersistentUniquenessProvider(val clock: Clock) : UniquenessProvider, Singl @Column(name = "consuming_transaction_id", nullable = true) val consumingTxHash: String? - ) : Serializable + ) @Entity @javax.persistence.Table(name = "${NODE_DATABASE_PREFIX}notary_request_log") @@ -62,7 +61,7 @@ class PersistentUniquenessProvider(val clock: Clock) : UniquenessProvider, Singl @Column(name = "request_timestamp", nullable = false) var requestDate: Instant - ) : Serializable + ) @Entity @javax.persistence.Table(name = "${NODE_DATABASE_PREFIX}notary_committed_states") diff --git a/node/src/main/kotlin/net/corda/node/services/transactions/RaftUniquenessProvider.kt b/node/src/main/kotlin/net/corda/node/services/transactions/RaftUniquenessProvider.kt index ea339c8140..3f771385a1 100644 --- a/node/src/main/kotlin/net/corda/node/services/transactions/RaftUniquenessProvider.kt +++ b/node/src/main/kotlin/net/corda/node/services/transactions/RaftUniquenessProvider.kt @@ -32,7 +32,6 @@ import net.corda.nodeapi.internal.config.NodeSSLConfiguration import net.corda.nodeapi.internal.config.SSLConfiguration import net.corda.nodeapi.internal.persistence.CordaPersistence import net.corda.nodeapi.internal.persistence.NODE_DATABASE_PREFIX -import java.io.Serializable import java.nio.file.Path import java.time.Clock import java.util.concurrent.CompletableFuture @@ -94,7 +93,7 @@ class RaftUniquenessProvider( var value: String? = "", @Column(name = "raft_log_index", nullable = false) var index: Long = 0 - ) : Serializable + ) /** Directory storing the Raft log and state machine snapshots */ private val storagePath: Path = transportConfiguration.baseDirectory diff --git a/node/src/main/kotlin/net/corda/node/services/upgrade/ContractUpgradeServiceImpl.kt b/node/src/main/kotlin/net/corda/node/services/upgrade/ContractUpgradeServiceImpl.kt index 909d98f11c..cef78a26bd 100644 --- a/node/src/main/kotlin/net/corda/node/services/upgrade/ContractUpgradeServiceImpl.kt +++ b/node/src/main/kotlin/net/corda/node/services/upgrade/ContractUpgradeServiceImpl.kt @@ -4,9 +4,8 @@ import net.corda.core.contracts.StateRef import net.corda.core.contracts.UpgradedContract import net.corda.core.node.services.ContractUpgradeService import net.corda.core.serialization.SingletonSerializeAsToken -import net.corda.nodeapi.internal.persistence.NODE_DATABASE_PREFIX import net.corda.node.utilities.PersistentMap -import java.io.Serializable +import net.corda.nodeapi.internal.persistence.NODE_DATABASE_PREFIX import javax.persistence.Column import javax.persistence.Entity import javax.persistence.Id @@ -24,7 +23,7 @@ class ContractUpgradeServiceImpl : ContractUpgradeService, SingletonSerializeAsT /** refers to the UpgradedContract class name*/ @Column(name = "contract_class_name", nullable = true) var upgradedContractClassName: String? = "" - ) : Serializable + ) private companion object { fun createContractUpgradesMap(): PersistentMap { diff --git a/node/src/main/kotlin/net/corda/node/services/vault/VaultSchema.kt b/node/src/main/kotlin/net/corda/node/services/vault/VaultSchema.kt index 4d0bacaa95..a1c7a7f8e8 100644 --- a/node/src/main/kotlin/net/corda/node/services/vault/VaultSchema.kt +++ b/node/src/main/kotlin/net/corda/node/services/vault/VaultSchema.kt @@ -11,7 +11,6 @@ import net.corda.core.schemas.PersistentState import net.corda.core.serialization.CordaSerializable import net.corda.core.utilities.OpaqueBytes import org.hibernate.annotations.Type -import java.io.Serializable import java.time.Instant import java.util.* import javax.persistence.* @@ -154,7 +153,7 @@ object VaultSchemaV1 : MappedSchema(schemaFamily = VaultSchema.javaClass, versio @Column(name = "note", nullable = true) var note: String? - ) : Serializable { + ) { constructor(txId: String, note: String) : this(0, txId, note) } } \ No newline at end of file diff --git a/node/src/test/kotlin/net/corda/node/services/persistence/AppendOnlyPersistentMapTest.kt b/node/src/test/kotlin/net/corda/node/services/persistence/AppendOnlyPersistentMapTest.kt index 9dba0ee9a6..b6ec99f77d 100644 --- a/node/src/test/kotlin/net/corda/node/services/persistence/AppendOnlyPersistentMapTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/persistence/AppendOnlyPersistentMapTest.kt @@ -6,14 +6,12 @@ import net.corda.node.internal.configureDatabase import net.corda.node.services.schema.NodeSchemaService import net.corda.node.utilities.AppendOnlyPersistentMap import net.corda.nodeapi.internal.persistence.DatabaseConfig - import net.corda.testing.node.MockServices.Companion.makeTestDataSourceProperties import org.junit.After import org.junit.Assert.* import org.junit.Test import org.junit.runner.RunWith import org.junit.runners.Parameterized -import java.io.Serializable import java.util.concurrent.CountDownLatch import javax.persistence.Column import javax.persistence.Entity @@ -270,7 +268,7 @@ class AppendOnlyPersistentMapTest(var scenario: Scenario) { @Column(name = "value", length = 16) var value: String = "" - ) : Serializable + ) class TestMap : AppendOnlyPersistentMap( toPersistentEntityKey = { it }, diff --git a/node/src/test/kotlin/net/corda/node/services/schema/NodeSchemaServiceTest.kt b/node/src/test/kotlin/net/corda/node/services/schema/NodeSchemaServiceTest.kt index b4536dd550..696353ba3d 100644 --- a/node/src/test/kotlin/net/corda/node/services/schema/NodeSchemaServiceTest.kt +++ b/node/src/test/kotlin/net/corda/node/services/schema/NodeSchemaServiceTest.kt @@ -20,7 +20,6 @@ import org.hibernate.annotations.Cascade import org.hibernate.annotations.CascadeType import org.junit.Ignore import org.junit.Test -import java.io.Serializable import javax.persistence.* import kotlin.test.assertEquals import kotlin.test.assertFalse @@ -142,7 +141,7 @@ object TestSchema : MappedSchema(SchemaFamily::class.java, 1, setOf(Parent::clas @Suppress("unused") @Entity @Table(name = "Children") - class Child : Serializable { + class Child { @Id @GeneratedValue @Column(name = "child_id", unique = true, nullable = false)