[ 
https://issues.apache.org/jira/browse/OPENJPA-683?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Richard Zowalla resolved OPENJPA-683.
-------------------------------------
    Resolution: Fixed

Already fixed on master: The discriminator column for CHAR gets JavaTypes.CHAR 
(AnnotationPersistenceMappingParser.java:888-889, 
XMLPersistenceMappingParser.java:524-525), and bd070b2c1 (OPENJPA-3033) sizes 
such CHAR columns to 1 (MappingInfo.java:776-779). On Sybase the numeric column 
is still the documented storeCharsAsNumbers=true default 
(DBDictionary.java:378), and it can be configured. Closing.

> 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.2.0
>
>
> 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 was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to