HHH-5342 Testes fail on mysql

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@19775 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Strong Liu 2010-06-20 19:55:55 +00:00
parent e6862c0be0
commit 7951998639
4 changed files with 10 additions and 3 deletions

View File

@ -34,7 +34,7 @@ import org.hibernate.test.annotations.TestCase;
* @author Steve Ebersole
*/
public class ExplicitSqlResultSetMappingTest extends TestCase {
private String queryString = "select t.\"NAME\" as \"QuotEd_nAMe\" from \"MY_ENTITY_TABLE\" t";
private String queryString = null;
@Override
protected Class<?>[] getAnnotatedClasses() {
@ -47,6 +47,9 @@ public class ExplicitSqlResultSetMappingTest extends TestCase {
}
private void prepareTestData() {
char open = getDialect().openQuote();
char close = getDialect().closeQuote();
queryString="select t."+open+"NAME"+close+" as "+open+"QuotEd_nAMe"+close+" from "+open+"MY_ENTITY_TABLE"+close+" t";
Session s = sfi().openSession();
s.beginTransaction();
s.save( new MyEntity( "mine" ) );

View File

@ -200,9 +200,9 @@ public class ComponentTest extends FunctionalTestCase {
.add( Property.forName("person.yob").between( new Integer(1999), new Integer(2002) ) )
.list();
if ( getDialect().supportsRowValueConstructorSyntax() ) {
s.createQuery("from User u where u.person = ('gavin', :dob, 'Peachtree Rd', 'Karbarook Ave', 1974, 'Peachtree Rd')")
s.createQuery("from User u where u.person = ('gavin', :dob, 'Peachtree Rd', 'Karbarook Ave', 1974, 34, 'Peachtree Rd')")
.setDate("dob", new Date("March 25, 1974")).list();
s.createQuery("from User where person = ('gavin', :dob, 'Peachtree Rd', 'Karbarook Ave', 1974, 'Peachtree Rd')")
s.createQuery("from User where person = ('gavin', :dob, 'Peachtree Rd', 'Karbarook Ave', 1974, 34, 'Peachtree Rd')")
.setDate("dob", new Date("March 25, 1974")).list();
}
t.commit();

View File

@ -40,6 +40,8 @@ public class MigrationTest extends UnitTestCase {
SchemaUpdate v2schemaUpdate = new SchemaUpdate( v2cfg );
v2schemaUpdate.execute( true, true );
assertEquals( 0, v2schemaUpdate.getExceptions().size() );
new SchemaExport( v2cfg ).drop( false, true );
}

View File

@ -49,6 +49,7 @@ public class NativeSqlAndQuotedIdentifiersTest extends DatabaseSpecificFunctiona
@Override
protected void prepareTest() throws Exception {
if(sfi()==null)return;
Session session = sfi().openSession();
session.beginTransaction();
session.save( new Person( "me" ) );
@ -58,6 +59,7 @@ public class NativeSqlAndQuotedIdentifiersTest extends DatabaseSpecificFunctiona
@Override
protected void cleanupTest() throws Exception {
if(sfi()==null)return;
Session session = sfi().openSession();
session.beginTransaction();
session.createQuery( "delete Person" ).executeUpdate();