[hibernate-issues] [Hibernate-JIRA] Created: (HHH-5325) Minor issues in test suite and suggestions for improvements

Fred Toussi (JIRA) noreply at atlassian.com
Sun Jun 20 16:01:20 EDT 2010


Minor issues in test suite and suggestions for improvements
-----------------------------------------------------------

                 Key: HHH-5325
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5325
             Project: Hibernate Core
          Issue Type: Improvement
          Components: testsuite
    Affects Versions: 3.5.3
         Environment: tested with HSQLDB 2.0
            Reporter: Fred Toussi
            Priority: Minor


hql:ASTParserLoadingTest : testComponentNullnessChecks()

String query = getDialect() instanceof DB2Dialect ?
"from Human where cast(? as string) is null" :
"from Human where ? is null"

The cast should be made by default. DB2 is highly SQL Standard conformant and displays the correct behaviour.
(SQL Standard Part 3: Call-Level Interface (SQL/CLI)) Others may "invent" a character type for the dynamic param.

-----------------------

legacy:FooBarTest : testFindByCriteria()

if(!(getDialect() instanceof TimesTenDialect)) {
list = s.createCriteria(Foo.class).setMaxResults(0).list();
		assertTrue( list.size()==0 );
}

The test produces the equivalent to SQL statements with "FETCH 0 ROWS ONLY" or "LIMIT 0" etc. This is explicitly stated to cause a data exception according to SQL:2008. The row count must be at least 1.

-----------------------

org.hibernate.test.hql : Animal.hbm.xml

This snippet is used in several tests. Search for "centimeters".

<property name="heightInches">
 <column name="height_centimeters" not-null="true" 
 read="height_centimeters / 2.54" 
 write="? * 2.54"/>
</property>   

The target SQL column type is created as DOUBLE in most dialects. The dynamic variable in "? * 2.54" first resolves to DECIMAL because the "declared type" of the numeric literal is DECIMAL. It would be better to use "? * 2.54E0" as a hint to use DOUBLE.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list