HHH-7744 @DiscriminatorColumn's default discriminatorType ignored

This commit is contained in:
brmeyer 2012-10-30 16:51:49 -04:00
parent 367d331fd7
commit d271ad7e6a
3 changed files with 7 additions and 11 deletions

View File

@ -222,10 +222,9 @@ public class RootEntityClass extends EntityClass {
discriminatorColumnValues = new Column( null ); //(stliu) give null here, will populate values below
discriminatorColumnValues.setNullable( false ); // discriminator column cannot be null
if ( discriminatorColumnAnnotation != null ) {
DiscriminatorType discriminatorType = Enum.valueOf(
DiscriminatorType.class, discriminatorColumnAnnotation.value( "discriminatorType" ).asEnum()
);
DiscriminatorType discriminatorType = JandexHelper.getValue(
discriminatorColumnAnnotation,
"discriminatorType", DiscriminatorType.class );
switch ( discriminatorType ) {
case STRING: {
type = String.class;

View File

@ -23,7 +23,8 @@
*/
package org.hibernate.test.annotations.id;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.hibernate.Session;
import org.hibernate.Transaction;
@ -46,17 +47,13 @@ import org.hibernate.test.annotations.id.entities.SoundSystem;
import org.hibernate.test.annotations.id.entities.Store;
import org.hibernate.test.annotations.id.entities.Tree;
import org.hibernate.test.util.SchemaUtil;
import org.hibernate.testing.FailureExpectedWithNewMetamodel;
import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
/**
* @author Emmanuel Bernard
*/
@SuppressWarnings("unchecked")
@FailureExpectedWithNewMetamodel
public class IdTest extends BaseCoreFunctionalTestCase {
@Test
public void testGenericGenerator() throws Exception {

View File

@ -10,7 +10,7 @@ import javax.persistence.IdClass;
*/
@Entity
@IdClass(FootballerPk.class)
@DiscriminatorColumn(name = "bibi")
@DiscriminatorColumn( name = "bibi", length = 53 )
public class Footballer {
private String firstname;
private String lastname;