[hibernate-issues] [Hibernate-JIRA] Created: (HHH-3587) HQL 'cast' function partially broken with MySQL

Manuel Dominguez Sarmiento (JIRA) noreply at atlassian.com
Mon Nov 3 17:40:04 EST 2008


HQL 'cast' function partially broken with MySQL
-----------------------------------------------

                 Key: HHH-3587
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3587
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.3.1
         Environment: MySQL 5
            Reporter: Manuel Dominguez Sarmiento
            Priority: Trivial


MySQLDialect .getCastTypeName() is not fully implemented. It breaks when trying to cast to LONG (BIGINT).

This can be easily fixed:

	public String getCastTypeName(int code) {
		if ( code==Types.INTEGER || code == Types.BIGINT ) {
			return "signed";
		}
		else if ( code==Types.VARCHAR ) {
			return "char";
		}
		else if ( code==Types.VARBINARY ) {
			return "binary";
		}
		else {
			return super.getCastTypeName( code );
		}
	}

-- 
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