diff --git a/hibernate-core/src/test/java/org/hibernate/test/cache/User.java b/hibernate-core/src/test/java/org/hibernate/test/cache/User.java index e550ebeca3..7cb2281708 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/cache/User.java +++ b/hibernate-core/src/test/java/org/hibernate/test/cache/User.java @@ -28,8 +28,10 @@ import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.ManyToOne; +import javax.persistence.Table; @Entity +@Table(name="`User`") public class User { @Id int id; diff --git a/hibernate-core/src/test/java/org/hibernate/test/generated/DefaultGeneratedValueTest.java b/hibernate-core/src/test/java/org/hibernate/test/generated/DefaultGeneratedValueTest.java index 2885fc7d44..5001eb82ba 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/generated/DefaultGeneratedValueTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/generated/DefaultGeneratedValueTest.java @@ -45,6 +45,8 @@ import org.hibernate.annotations.Generated; import org.hibernate.annotations.GenerationTime; import org.hibernate.annotations.GeneratorType; import org.hibernate.annotations.UpdateTimestamp; +import org.hibernate.dialect.SybaseDialect; +import org.hibernate.testing.SkipForDialect; import org.hibernate.testing.TestForIssue; import org.hibernate.testing.junit4.BaseCoreFunctionalTestCase; import org.hibernate.tuple.ValueGenerator; @@ -57,6 +59,7 @@ import org.junit.Test; * @author Steve Ebersole * @author Gunnar Morling */ +@SkipForDialect(value=SybaseDialect.class, comment="CURRENT_TIMESTAMP not supported as default value in Sybase") public class DefaultGeneratedValueTest extends BaseCoreFunctionalTestCase { @Test diff --git a/hibernate-core/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java b/hibernate-core/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java index 287ed08a18..2d89ad71c0 100644 --- a/hibernate-core/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java +++ b/hibernate-core/src/test/java/org/hibernate/test/sql/hand/query/NativeSQLQueriesTest.java @@ -1,5 +1,12 @@ package org.hibernate.test.sql.hand.query; +import static org.hibernate.testing.junit4.ExtraAssertions.assertClassAssignability; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + import java.io.Serializable; import java.math.BigDecimal; import java.math.BigInteger; @@ -8,7 +15,6 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import org.junit.Test; import org.hibernate.Hibernate; import org.hibernate.HibernateException; import org.hibernate.Query; @@ -18,8 +24,8 @@ import org.hibernate.Session; import org.hibernate.Transaction; import org.hibernate.cfg.Configuration; import org.hibernate.cfg.Environment; -import org.hibernate.dialect.H2Dialect; import org.hibernate.dialect.AbstractHANADialect; +import org.hibernate.dialect.H2Dialect; import org.hibernate.dialect.MySQL5Dialect; import org.hibernate.engine.query.spi.sql.NativeSQLQueryReturn; import org.hibernate.engine.spi.NamedSQLQueryDefinitionBuilder; @@ -46,13 +52,7 @@ import org.hibernate.type.FloatType; import org.hibernate.type.LongType; import org.hibernate.type.StringType; import org.hibernate.type.TimestampType; - -import static org.hibernate.testing.junit4.ExtraAssertions.assertClassAssignability; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; +import org.junit.Test; /** * Tests of various features of native SQL queries. @@ -148,7 +148,7 @@ public class NativeSQLQueriesTest extends BaseCoreFunctionalTestCase { { final NamedSQLQueryDefinitionBuilder builder = new NamedSQLQueryDefinitionBuilder(); builder.setName("namedQuery"); - builder.setQuery("select count(*) AS count from organization"); + builder.setQuery("select count(*) AS c from organization"); builder.setQueryReturns(new NativeSQLQueryReturn[1]); sessionFactory().registerNamedSQLQueryDefinition("namedQuery", builder.createNamedQueryDefinition()); @@ -156,13 +156,13 @@ public class NativeSQLQueriesTest extends BaseCoreFunctionalTestCase { final Session s = openSession(); s.beginTransaction(); final SQLQuery query = (SQLQuery) s.getNamedQuery("namedQuery"); - query.addScalar("count"); - final Object result = query.uniqueResult(); + query.addScalar("c"); + final Number result = (Number) query.uniqueResult(); s.getTransaction().commit(); s.close(); assertNotNull(result); - assertEquals(BigInteger.valueOf(0), result); + assertTrue(0 == result.intValue()); } @Test