[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-3551) Boolean substitution in informix
Rouvignac (JIRA)
noreply at atlassian.com
Tue Jan 11 03:58:05 EST 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3551?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39559#action_39559 ]
Rouvignac commented on HHH-3551:
--------------------------------
Well, as i remember, while testing i put a breakpoint in my custom dialect toBooleanValueString method but the execution never suspended threre.
I keeped toBooleanValueString because org.hibernate.dialect.InformixDialect is incorrect in Hibernate 3.2.7 version we use.
As i am sure i didn't test all dialect use case, i prefered to keep toBooleanValueString.
As i can see Laird Nelson added "'" around return values in toBooleanValueString : public String toBooleanValueString(boolean bool) { return bool ? "'t'" : "'f'"; }
This seems to indicate a bug in my dialect.
I think he uses a latest version than hibernate 3.2.7 in which toBooleanValueString is more usefull. That should be why my breakpoint never suspended execution.
> Boolean substitution in informix
> --------------------------------
>
> Key: HHH-3551
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3551
> Project: Hibernate Core
> Issue Type: Bug
> Components: query-sql
> Affects Versions: 3.3.1
> Environment: Hibernate 3.2
> Informix 9.40
> Reporter: Rouvignac
> Original Estimate: 2h
> Remaining Estimate: 2h
>
> HQL Query :
> select order from Order order where order.printed = ?
> Parameter :
> true, false, Boolean.TRUE or Boolean.FALSE
> When the request is executed we get the following error :
> SQLSTATE: IX000
> SQL CODE: -674
> 674: Routine (equal) can not be resolved.
> If as parameter we use "t" ot "f" everything works fine but it will not work with other DB.
> As a workaround we can use :
> property name="hibernate.query.substitutions">true t, false f</property>
> I investigated in Dialects :
> Dialect.java
> public String toBooleanValueString(boolean bool) {
> return bool ? "1" : "0";
> }
> PostgreSQLDialect.java
> public String toBooleanValueString(boolean bool) {
> return bool ? "true" : "false";
> }
> InformixDialect.java uses Dialect.java toBooleanValueString method.
> In my mind toBooleanValueString should be added to InformixDialect.java as follow :
> public String toBooleanValueString(boolean bool) {
> return bool ? "t" : "f";
> }
--
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