openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Vorburger (JIRA)" <j...@apache.org>
Subject [jira] Created: (OPENJPA-683) DiscriminatorType.CHAR doesn't work under Sybase - char defaults to CHAR(255) instead of CHAR(1) under Sybase (and other databases??)
Date Fri, 08 Aug 2008 14:43:45 GMT
DiscriminatorType.CHAR doesn't work under Sybase - char defaults to CHAR(255) instead of CHAR(1)
under Sybase (and other databases??)
-------------------------------------------------------------------------------------------------------------------------------------

                 Key: OPENJPA-683
                 URL: https://issues.apache.org/jira/browse/OPENJPA-683
             Project: OpenJPA
          Issue Type: Bug
          Components: sql
    Affects Versions: 1.1.0
            Reporter: Michael Vorburger
            Priority: Minor
             Fix For: 1.1.1


Hello,

@DiscriminatorColumn(discriminatorType=DiscriminatorType.CHAR) doesn't work under Sybase,
it creates a numeric / integer (?) column.

This is because of the default "storeCharsAsNumbers = true" in the DBDictionary (what's that
good for? why would you want to store-char-as-numbers ??).

Setting storeCharsAsNumbers = false is still not enough, as that will lead to a CHAR(255).
You also need to add "fixedSizeTypeNameSet.addAll(Arrays.asList(new String[]{ "CHAR" }));"
to a custom DBDictionary. (Wouldn't it make sense to have CHAR in fixedSizeTypeNameSet by
default for all DBDictionaries?)

I'm assuming all of the same also applies to Java Entity attributes of Type char, not just
DiscriminatorType.CHAR (but haven't further looked into this).

PS: With a custom DBDictionary with { storeCharsAsNumbers = false; fixedSizeTypeNameSet.addAll(Arrays.asList(new
String[]{ "CHAR" })); } in the constructor this does work; so I have a work-around for this,
just posting this for the benefit of other OpenJPA/Sybase users.

Regards,
Michael Vorburger

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message