diff --git a/annotations/src/test/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java b/annotations/src/test/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java index a538febdb3..f79f183c39 100644 --- a/annotations/src/test/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java +++ b/annotations/src/test/java/org/hibernate/test/annotations/manytoone/referencedcolumnname/ManyToOneReferencedColumnNameTest.java @@ -34,6 +34,14 @@ public class ManyToOneReferencedColumnNameTest extends TestCase { s.close(); } + + @Override + protected boolean runForCurrentDialect() { + return super.runForCurrentDialect() && getDialect().supportsIdentityColumns(); + } + + + protected Class[] getMappings() { return new Class[] { Item.class, diff --git a/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmTest.java b/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmTest.java index 86686e93bf..3639ae1990 100644 --- a/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmTest.java +++ b/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmTest.java @@ -4,7 +4,6 @@ package org.hibernate.test.annotations.xml.hbm; import java.util.HashSet; import org.hibernate.Session; -import org.hibernate.cfg.Configuration; import org.hibernate.test.annotations.TestCase; /** @@ -63,32 +62,10 @@ public class HbmTest extends TestCase { s.close(); } - public void testManyToOneAndInterface() throws Exception { - Session s = openSession(); - s.getTransaction().begin(); - B b = new BImpl(); - b.setBId( 1 ); - s.persist( b ); - Z z = new ZImpl(); - z.setB( b ); - s.persist( z ); - s.flush(); - s.getTransaction().rollback(); - s.close(); - } - - @Override - protected void configure(Configuration cfg) { - super.configure( cfg ); - //cfg.addClass( Government.class ); - } - protected Class[] getMappings() { return new Class[]{ PrimeMinister.class, Sky.class, - ZImpl.class - }; } @@ -97,8 +74,6 @@ public class HbmTest extends TestCase { return new String[]{ "org/hibernate/test/annotations/xml/hbm/Government.hbm.xml", "org/hibernate/test/annotations/xml/hbm/CloudType.hbm.xml", - "org/hibernate/test/annotations/xml/hbm/A.hbm.xml", - "org/hibernate/test/annotations/xml/hbm/B.hbm.xml" }; } } diff --git a/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java b/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java new file mode 100644 index 0000000000..eb10aecde5 --- /dev/null +++ b/annotations/src/test/java/org/hibernate/test/annotations/xml/hbm/HbmWithIdentityTest.java @@ -0,0 +1,47 @@ +//$Id:HbmTest.java 9793 2006-04-26 02:20:18 -0400 (mer., 26 avr. 2006) epbernard $ +package org.hibernate.test.annotations.xml.hbm; + +import org.hibernate.Session; +import org.hibernate.test.annotations.TestCase; + +/** + * @author Emmanuel Bernard + */ +public class HbmWithIdentityTest extends TestCase { + public void testManyToOneAndInterface() throws Exception { + Session s = openSession(); + s.getTransaction().begin(); + B b = new BImpl(); + b.setBId( 1 ); + s.persist( b ); + Z z = new ZImpl(); + z.setB( b ); + s.persist( z ); + s.flush(); + s.getTransaction().rollback(); + s.close(); + } + + @Override + protected boolean runForCurrentDialect() { + return super.runForCurrentDialect() && getDialect().supportsIdentityColumns(); + } + + + + protected Class[] getMappings() { + return new Class[]{ + Sky.class, + ZImpl.class + + }; + } + + @Override + protected String[] getXmlFiles() { + return new String[]{ + "org/hibernate/test/annotations/xml/hbm/A.hbm.xml", + "org/hibernate/test/annotations/xml/hbm/B.hbm.xml" + }; + } +}