Rremoving a @FailureExpected by syncing the setup between hbm and annotation based configuration for AbstractBasicBindingTests

This commit is contained in:
Hardy Ferentschik 2012-08-30 17:44:40 +02:00
parent 289866968b
commit 22d6c78a0d
3 changed files with 13 additions and 15 deletions

View File

@ -23,10 +23,7 @@
*/
package org.hibernate.metamodel.spi.binding;
import org.junit.Test;
import org.hibernate.metamodel.MetadataSources;
import org.hibernate.testing.FailureExpected;
/**
* Basic tests of annotation based binding code
@ -35,12 +32,6 @@ import org.hibernate.testing.FailureExpected;
*/
public class BasicAnnotationBindingTests extends AbstractBasicBindingTests {
@Test
@FailureExpected( jiraKey = "HHH-7037" )
public void testEntityWithManyToOneMapping() {
super.testEntityWithManyToOneMapping();
}
@Override
public void addSourcesForSimpleEntityBinding(MetadataSources sources) {
sources.addAnnotatedClass( SimpleEntity.class );

View File

@ -31,18 +31,23 @@ import org.hibernate.metamodel.MetadataSources;
* @author Steve Ebersole
*/
public class BasicHbmBindingTests extends AbstractBasicBindingTests {
@Override
public void addSourcesForSimpleEntityBinding(MetadataSources sources) {
sources.addResource( "org/hibernate/metamodel/spi/binding/SimpleEntity.hbm.xml" );
}
@Override
public void addSourcesForSimpleVersionedEntityBinding(MetadataSources sources) {
sources.addResource( "org/hibernate/metamodel/spi/binding/SimpleVersionedEntity.hbm.xml" );
}
@Override
public void addSourcesForManyToOne(MetadataSources sources) {
sources.addResource( "org/hibernate/metamodel/spi/binding/EntityWithManyToOnes.hbm.xml" );
}
@Override
public void addSourcesForComponentBinding(MetadataSources sources) {
sources.addResource( "org/hibernate/metamodel/spi/binding/SimpleEntityWithSimpleComponent.hbm.xml" );
}

View File

@ -24,6 +24,7 @@
package org.hibernate.metamodel.spi.binding;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
@ -33,13 +34,9 @@ import javax.persistence.ManyToOne;
*/
@Entity
public class EntityWithManyToOnes {
@Id
private Long id;
private String theName;
@ManyToOne
SimpleEntity simpleEntity;
@ManyToOne
@JoinColumn( name = "simplename", referencedColumnName = "name" )
SimpleEntity simpleEntityFromPropertyRef;
public EntityWithManyToOnes() {
@ -49,6 +46,7 @@ public class EntityWithManyToOnes {
this.theName = name;
}
@Id
public Long getId() {
return id;
}
@ -65,6 +63,8 @@ public class EntityWithManyToOnes {
this.theName = name;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(nullable = false)
public SimpleEntity getSimpleEntity() {
return simpleEntity;
}
@ -73,6 +73,8 @@ public class EntityWithManyToOnes {
this.simpleEntity = simpleEntity;
}
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "simplename", referencedColumnName = "name")
public SimpleEntity getSimpleEntityFromPropertyRef() {
return simpleEntityFromPropertyRef;
}