#1371 - Regression in 11.15.5 with @Inheritance on abstract class with discriminatorType = INTEGER

This commit is contained in:
rob bygrave
2018-05-10 17:20:09 +12:00
parent 111bac7514
commit cfaedcdbc5
4 changed files with 92 additions and 6 deletions
@@ -0,0 +1,48 @@
package org.tests.inheritance.abstrakt;
import javax.persistence.DiscriminatorColumn;
import javax.persistence.DiscriminatorType;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.Table;
import javax.persistence.Version;
@Entity
@Table(name = "block")
@Inheritance
@DiscriminatorColumn(name = "case_type", discriminatorType = DiscriminatorType.INTEGER)
public abstract class AbstractBaseBlock {
@Id
long id;
String name;
@Version
long version;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public long getVersion() {
return version;
}
public void setVersion(long version) {
this.version = version;
}
}
@@ -0,0 +1,19 @@
package org.tests.inheritance.abstrakt;
import javax.persistence.DiscriminatorValue;
import javax.persistence.Entity;
@Entity
@DiscriminatorValue(value = "2")
public class Block extends AbstractBaseBlock {
String notes;
public String getNotes() {
return notes;
}
public void setNotes(String notes) {
this.notes = notes;
}
}
@@ -0,0 +1,18 @@
package org.tests.inheritance.abstrakt;
import io.ebean.BaseTestCase;
import io.ebean.Ebean;
import org.junit.Test;
public class TestInheritanceNum extends BaseTestCase {
@Test
public void basicIUD() {
Block block = new Block();
block.setName("ibe");
block.setNotes("try it");
Ebean.save(block);
}
}