mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1371 - Regression in 11.15.5 with @Inheritance on abstract class with discriminatorType = INTEGER
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user