[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6717) oracle does not have a boolean type

Gail Badner (JIRA) noreply at atlassian.com
Mon Oct 10 16:54:20 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6717?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43981#comment-43981 ] 

Gail Badner commented on HHH-6717:
----------------------------------

The patch for HHH-6705 maps Types.BOOLEAN to number(1,0) and includes a test case.

Here is what I've found on this topic in Oracle 11g Release 1 of "Oracle® Database JDBC Developer's Guide and Reference". It seems to indicate that the mapping should be to a NUMBER, rather than a CHAR.

There is "Table 11-1 Default Mappings Between SQL Types and Java Types" at http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/datacc.htm#g1028145 .

It shows Java boolean mapped to Oracle NUMBER and java.sql.Types.BIT (java.sql.Types.BOOLEAN is not listed).

Also, under http://download.oracle.com/docs/cd/B28359_01/java.111/b31224/datacc.htm#autoId14 is:

getBoolean

Because there is no BOOLEAN database type, when you use getBoolean a data type conversion always occurs. The getBoolean method is supported only for numeric columns. When applied to these columns, getBoolean interprets any zero value as false and any other value as true. When applied to any other sort of column, getBoolean raises the exception java.lang.NumberFormatException.

> oracle does not have a boolean type
> -----------------------------------
>
>                 Key: HHH-6717
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6717
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core
>            Reporter: Strong Liu
>            Assignee: Strong Liu
>             Fix For: 4.0.0.next
>
>
> now Dialect has mapped Types.BOOLEAN to 'boolean' by default, then we need change this in Oracle dialect to let it map to _char(1)_

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list