mirror of
https://github.com/corda/corda.git
synced 2025-02-20 17:33:15 +00:00
Move test Java schemas to Kotlin as they are used only by Kotlin JUnit test (was causing ASM compilation failure).
This commit is contained in:
parent
fa738c1354
commit
7afd1e8b25
@ -1,37 +0,0 @@
|
||||
package net.corda.core.schemas;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class BadSchemaJavaV1 extends MappedSchema {
|
||||
|
||||
public BadSchemaJavaV1() {
|
||||
super(TestJavaSchemaFamily.class, 1, Arrays.asList(State.class));
|
||||
}
|
||||
|
||||
@Entity
|
||||
public static class State extends PersistentState {
|
||||
private String id;
|
||||
private GoodSchemaJavaV1.State other;
|
||||
|
||||
@Column
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@JoinColumns({@JoinColumn(name = "itid"), @JoinColumn(name = "outid")})
|
||||
@OneToOne
|
||||
@MapsId
|
||||
public GoodSchemaJavaV1.State getOther() {
|
||||
return other;
|
||||
}
|
||||
|
||||
public void setOther(GoodSchemaJavaV1.State other) {
|
||||
this.other = other;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
package net.corda.core.schemas;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class BadSchemaNoGetterJavaV1 extends MappedSchema {
|
||||
|
||||
public BadSchemaNoGetterJavaV1() {
|
||||
super(TestJavaSchemaFamily.class, 1, Arrays.asList(State.class));
|
||||
}
|
||||
|
||||
@Entity
|
||||
public static class State extends PersistentState {
|
||||
@JoinColumns({@JoinColumn(name = "itid"), @JoinColumn(name = "outid")})
|
||||
@OneToOne
|
||||
@MapsId
|
||||
public GoodSchemaJavaV1.State other;
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package net.corda.core.schemas;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class GoodSchemaJavaV1 extends MappedSchema {
|
||||
|
||||
public GoodSchemaJavaV1() {
|
||||
super(TestJavaSchemaFamily.class, 1, Arrays.asList(State.class));
|
||||
}
|
||||
|
||||
@Entity
|
||||
public static class State extends PersistentState {
|
||||
private String id;
|
||||
|
||||
@Column
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
package net.corda.core.schemas;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Transient;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class PoliteSchemaJavaV1 extends MappedSchema {
|
||||
|
||||
public PoliteSchemaJavaV1() {
|
||||
super(TestJavaSchemaFamily.class, 1, Arrays.asList(State.class));
|
||||
}
|
||||
|
||||
@Entity
|
||||
public static class State extends PersistentState {
|
||||
private String id;
|
||||
private GoodSchemaJavaV1.State other;
|
||||
|
||||
@Column
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Transient
|
||||
public GoodSchemaJavaV1.State getOther() {
|
||||
return other;
|
||||
}
|
||||
|
||||
public void setOther(GoodSchemaJavaV1.State other) {
|
||||
this.other = other;
|
||||
}
|
||||
}
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
package net.corda.core.schemas;
|
||||
|
||||
public class TestJavaSchemaFamily {
|
||||
}
|
@ -1,36 +0,0 @@
|
||||
package net.corda.core.schemas;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import java.util.Arrays;
|
||||
|
||||
public class TrickySchemaJavaV1 extends MappedSchema {
|
||||
|
||||
public TrickySchemaJavaV1() {
|
||||
super(TestJavaSchemaFamily.class, 1, Arrays.asList(TrickySchemaJavaV1.State.class));
|
||||
}
|
||||
|
||||
@Entity
|
||||
public static class State extends PersistentState {
|
||||
private String id;
|
||||
private GoodSchemaJavaV1.State other;
|
||||
|
||||
@Column
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
//the field is a cross-reference to other MappedSchema however the field is not persistent (no JPA annotation)
|
||||
public GoodSchemaJavaV1.State getOther() {
|
||||
return other;
|
||||
}
|
||||
|
||||
public void setOther(GoodSchemaJavaV1.State other) {
|
||||
this.other = other;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package net.corda.core.schemas
|
||||
|
||||
import java.util.*
|
||||
import javax.persistence.*
|
||||
|
||||
class BadSchemaNoGetterV1 : MappedSchema(TestJavaSchemaFamily::class.java, 1, Arrays.asList(State::class.java)) {
|
||||
|
||||
@Entity
|
||||
class State : PersistentState() {
|
||||
@JoinColumns(JoinColumn(name = "itid"), JoinColumn(name = "outid"))
|
||||
@OneToOne
|
||||
@MapsId
|
||||
var other: GoodSchemaV1.State? = null
|
||||
@get:Column
|
||||
var id: String? = null
|
||||
}
|
||||
}
|
17
core/src/test/kotlin/net/corda/core/schemas/BadSchemaV1.kt
Normal file
17
core/src/test/kotlin/net/corda/core/schemas/BadSchemaV1.kt
Normal file
@ -0,0 +1,17 @@
|
||||
package net.corda.core.schemas
|
||||
|
||||
import java.util.*
|
||||
import javax.persistence.*
|
||||
|
||||
class BadSchemaV1 : MappedSchema(TestJavaSchemaFamily::class.java, 1, Arrays.asList(State::class.java)) {
|
||||
|
||||
@Entity
|
||||
class State : PersistentState() {
|
||||
@get:Column
|
||||
var id: String? = null
|
||||
@get:JoinColumns(JoinColumn(name = "itid"), JoinColumn(name = "outid"))
|
||||
@get:OneToOne
|
||||
@get:MapsId
|
||||
var other: GoodSchemaV1.State? = null
|
||||
}
|
||||
}
|
14
core/src/test/kotlin/net/corda/core/schemas/GoodSchemaV1.kt
Normal file
14
core/src/test/kotlin/net/corda/core/schemas/GoodSchemaV1.kt
Normal file
@ -0,0 +1,14 @@
|
||||
package net.corda.core.schemas
|
||||
|
||||
import java.util.*
|
||||
import javax.persistence.Column
|
||||
import javax.persistence.Entity
|
||||
|
||||
class GoodSchemaV1 : MappedSchema(TestJavaSchemaFamily::class.java, 1, Arrays.asList(State::class.java)) {
|
||||
|
||||
@Entity
|
||||
class State : PersistentState() {
|
||||
@get:Column
|
||||
var id: String? = null
|
||||
}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package net.corda.core.schemas
|
||||
|
||||
import java.util.*
|
||||
import javax.persistence.Column
|
||||
import javax.persistence.Entity
|
||||
import javax.persistence.Transient
|
||||
|
||||
class PoliteSchemaV1 : MappedSchema(TestJavaSchemaFamily::class.java, 1, Arrays.asList(State::class.java)) {
|
||||
|
||||
@Entity
|
||||
class State : PersistentState() {
|
||||
@get:Column
|
||||
var id: String? = null
|
||||
@get:Transient
|
||||
var other: GoodSchemaV1.State? = null
|
||||
}
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
package net.corda.core.schemas
|
||||
|
||||
class TestJavaSchemaFamily
|
@ -0,0 +1,16 @@
|
||||
package net.corda.core.schemas
|
||||
|
||||
import java.util.*
|
||||
import javax.persistence.Column
|
||||
import javax.persistence.Entity
|
||||
|
||||
class TrickySchemaV1 : MappedSchema(TestJavaSchemaFamily::class.java, 1, Arrays.asList(TrickySchemaV1.State::class.java)) {
|
||||
|
||||
@Entity
|
||||
class State : PersistentState() {
|
||||
@get:Column
|
||||
var id: String? = null
|
||||
//the field is a cross-reference to other MappedSchema however the field is not persistent (no JPA annotation)
|
||||
var other: GoodSchemaV1.State? = null
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user