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

View File

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

View File

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