[
https://issues.apache.org/jira/browse/OPENJPA-2242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Albert Lee updated OPENJPA-2242:
--------------------------------
Patch Info: Patch Available
> Hard coded column size in CAST(? AS VARCHAR(254)) for DB2 caused runtime
> failure
> --------------------------------------------------------------------------------
>
> Key: OPENJPA-2242
> URL: https://issues.apache.org/jira/browse/OPENJPA-2242
> Project: OpenJPA
> Issue Type: Bug
> Components: sql
> Affects Versions: 2.0.3, 2.1.2, 2.3.0, 2.2.1
> Reporter: Albert Lee
> Assignee: Albert Lee
> Attachments: OPENJPA-2242.patch
>
>
> When procedure call is used in criteria builder as described in the following
> code snippet,
> a hard coded column size in CAST(? AS VARCHAR(#)) for DB2 is generated and
> caused run-time failure with a SQLCODE=-302, SQLSTATE=22001
> CriteriaBuilder cb = em.getCriteriaBuilder();
> CriteriaQuery<SimpleEntity> criteriaQuery =
> cb.createQuery(SimpleEntity.class);
> Root<SimpleEntity> simpleEntity =
> criteriaQuery.from(SimpleEntity.class);
> Expression<String> func1 = null;
> Expression<Double> func2 = null;
> func2 = cb.function(
> "st_point",
> Double.class,
> cb.literal("abcd......"), // error if String.length > 254
> cb.literal(1003));
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira