mirror of https://github.com/apache/openjpa.git
OPENJPA-394 (bug in 1.0.x) : DB2 CAST ? AS VARCHAR missing LENGTH
git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/1.0.x@582581 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
77ce13d6fc
commit
6c1b918371
|
@ -733,7 +733,10 @@ public class DB2Dictionary
|
|||
String sqlString = buf.getSQL(false);
|
||||
if (sqlString.endsWith("?")) {
|
||||
// case "(?" - convert to "CAST(? AS type"
|
||||
String str = "CAST(? AS " + getTypeName(type) + ")";
|
||||
String typeName = getTypeName(type);
|
||||
if (String.class.equals(val.getType()))
|
||||
typeName = typeName + "(" + characterColumnSize + ")";
|
||||
String str = "CAST(? AS " + typeName + ")";
|
||||
buf.replaceSqlString(sqlString.length() - 1,
|
||||
sqlString.length(), str);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue