[
https://issues.apache.org/jira/browse/OPENJPA-1658?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Richard Zowalla resolved OPENJPA-1658.
--------------------------------------
Resolution: Fixed
Already fixed on master: InValueDiscriminatorStrategy reads the value with
res.getObject (line 126), which for STRING goes to getStringInternal and then
_dict.getString (ResultSetResult.java:481-482, 574), and getString trims when
the opt-in switch trimStringColumns is on (DBDictionary.java:382, 1196-1199;
OPENJPA-2123, fdda69758). Closing.
> Enhance OpenJPA Support of Polymorphic Tables
> ---------------------------------------------
>
> Key: OPENJPA-1658
> URL: https://issues.apache.org/jira/browse/OPENJPA-1658
> Project: OpenJPA
> Issue Type: Improvement
> Components: jpa
> Affects Versions: 1.2.2
> Environment: WebSphere Application Server on Linux and DB2 on AIX
> Reporter: Pat Grady
> Priority: Major
>
> I'm building an application using polymorphic tables or more specifically a
> joined table pattern. The discriminator column is implemented in DB2 9.5 as
> a char(10) field and the discriminator value is variable in its length. The
> behavior within the application is that I can create and persist the object
> with no issues. When attempting to retrieve objects, no objects return.
> Tracing the issue shows that JPA is finding the object but not returning it
> because the persisted value space-padded to 10 characters (as is expected in
> a char field) does not equal the non-space-padded value in the .java files.
> If I change the DB column to varchar, everything works as expected; my DBA
> wants the char field for performance reasons. Suggest providing a switch of
> some sort (e.g., a value in an annotation tag) to treat the discriminator
> column comparison as trimmed to support a persisted char value.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)