[ 
https://issues.apache.org/jira/browse/OPENJPA-2558?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14329689#comment-14329689
 ] 

Heath Thomann commented on OPENJPA-2558:
----------------------------------------

Mark, 
  The changes in DBDictionary make use of a method called 'getUserClassLoader'. 
 This method doesn't exists on 2.2.x.  It was added in trunk via JIRA 
OPENJPA-2057.  If you want this feature to be back ported to 2.2.x, can you 
find a different solution so as not to depend on 'getUserClassLoader'.  I 
suppose one option is to backport OPENJPA-2057.  But a) I don't know of I'd 
feel comfortable doing this in a service release version, and b) seems a bit 
funny back porting it just for the purposes of this JIRA.

Thanks,

Heath

> Implement a way to select the db representation of Boolean values
> -----------------------------------------------------------------
>
>                 Key: OPENJPA-2558
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2558
>             Project: OpenJPA
>          Issue Type: New Feature
>          Components: jdbc
>    Affects Versions: 2.3.0, 2.4.0
>            Reporter: Mark Struberg
>            Assignee: Mark Struberg
>             Fix For: 2.4.0
>
>         Attachments: OPENJPA-2558.patch
>
>
> Many Databases do not natively support the SQL-99 BOOLEAN datatype. Boolean 
> and boolean fields in JPA entities will thus get represented as another type 
> in the database. OpenJPA currently has a hardcoded mapping to int 1/0 in the 
> base DBDictionary.
> But many existing databases don't use NUMBER(1) as column type but e.g. 
> CHAR(1) (because it uses less space in the index). 
> There are also all sorts of possible representations where one of those is 
> usually consistently used throughout a customer application:
> * Native Boolean -> PreparedStatement#setBoolean
> * Int 0/1 -> PreparedStatement#setInt
> * String "Y"/"N" -> PreparedStatement#setString
> * String "T"/"F" -> PreparedStatement#setString
> * String "y"/"n" -> PreparedStatement#setString
> * String "t"/"f" -> PreparedStatement#setString
> And I've also seen translated ones: "J"/"N" in german apps for "Ja"/ "Nein" 
> (yes/no).
> So it should be possible to even add your own custom BooleanRepresentation.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to