[hibernate-issues] [Hibernate-JIRA] Created: (HHH-2740) SAPDBDialect generates wrong boolean expressions

Matthias Wuttke (JIRA) noreply at atlassian.com
Mon Jul 23 15:52:52 EDT 2007


SAPDBDialect generates wrong boolean expressions
------------------------------------------------

                 Key: HHH-2740
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2740
             Project: Hibernate3
          Issue Type: Bug
          Components: core
         Environment: SAP DB 7.6
            Reporter: Matthias Wuttke


The following code fragment works for MySQL, but does not for SAP-DB / MaxDB:

bulkUpdate("UPDATE MyObject SET recent = false");

The query Hibernate generates is:

update my_object set recent=0

The MaxDB error is "Constant must be compatible with column type and length". The following query works:

update my_object set recent=false

The same problem applies to SELECT queries generated by Hibernate for use with the SAPDB / MaxDB. 

The following class fixes the problem (if you set it as the dialect to use):

public class ExtSAPDBDialect extends SAPDBDialect {

	@Override
	public String toBooleanValueString(boolean bool) {
		return Boolean.toString(bool);
	}
	
}

To fix the bug, I think one should change SAPDBDialect.toBooleanValueString(boolean).

hbm2ddl has some more bugs when using it with MaxDB. eg. using ";" as the statement separator, choosing the wrong column type for Strings longer than 4000 chars (but these bugs are not that bad). ;-)

Best regards
Matthias

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