HHH-6560 : Discriminator match value is not initialized in root EntityBinding
This commit is contained in:
parent
50ee956d49
commit
5ee60b1ca4
|
@ -388,6 +388,7 @@ public class Binder {
|
|||
discriminator.setForced( discriminatorSource.isForced() );
|
||||
|
||||
entityBinding.getHierarchyDetails().setEntityDiscriminator( discriminator );
|
||||
entityBinding.setDiscriminatorMatchValue( entitySource.getDiscriminatorMatchValue() );
|
||||
}
|
||||
|
||||
private void bindDiscriminatorValue(SubclassEntitySource entitySource, EntityBinding entityBinding) {
|
||||
|
|
|
@ -287,6 +287,13 @@ public class InheritanceBindingTest extends BaseAnnotationBindingTestCase {
|
|||
assertFalse( "Wrong default value", discriminator.isInserted() );
|
||||
}
|
||||
|
||||
@Test
|
||||
@Resources(annotatedClasses = { Base.class, Jump.class })
|
||||
public void testRootDiscriminatorMatchValue() {
|
||||
EntityBinding rootEntityBinding = getEntityBinding( Base.class );
|
||||
assertEquals( "base", rootEntityBinding.getDiscriminatorMatchValue() );
|
||||
}
|
||||
|
||||
@Test
|
||||
@Resources(annotatedClasses = { Fruit.class, Apple.class })
|
||||
public void testDiscriminatorFormula() {
|
||||
|
@ -336,6 +343,7 @@ public class InheritanceBindingTest extends BaseAnnotationBindingTestCase {
|
|||
}
|
||||
|
||||
@Entity
|
||||
@DiscriminatorValue("base")
|
||||
@DiscriminatorOptions(force = true, insert = false)
|
||||
class Base {
|
||||
@Id
|
||||
|
|
Loading…
Reference in New Issue