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:
josecoll 2019-05-14 18:29:08 +01:00
parent fa738c1354
commit 7afd1e8b25
12 changed files with 84 additions and 169 deletions

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -1,4 +0,0 @@
package net.corda.core.schemas;
public class TestJavaSchemaFamily {
}

View File

@ -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;
}
}
}

View File

@ -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
}
}

View 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
}
}

View 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
}
}

View File

@ -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
}
}

View File

@ -0,0 +1,3 @@
package net.corda.core.schemas
class TestJavaSchemaFamily

View File

@ -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
}
}