OPENJPA-1841: Use length() function to determine BLOB/CLOB nullity for Oracle.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1024340 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Dick 2010-10-19 17:57:04 +00:00
parent 75bbc90899
commit 005a18a739
2 changed files with 20 additions and 12 deletions

View File

@ -238,18 +238,6 @@ abstract class MaxEmbeddedLobFieldStrategy
return res.getObject(col, null, joins);
}
public void appendIsNull(SQLBuffer sql, Select sel, Joins joins) {
joins = join(joins, false);
sql.append(sel.getColumnAlias(field.getColumns()[0], joins)).
append(" IS ").appendValue(null, field.getColumns()[0]);
}
public void appendIsNotNull(SQLBuffer sql, Select sel, Joins joins) {
joins = join(joins, false);
sql.append(sel.getColumnAlias(field.getColumns()[0], joins)).
append(" IS NOT ").appendValue(null, field.getColumns()[0]);
}
public Joins join(Joins joins, boolean forceOuter) {
return field.join(joins, forceOuter, false);
}

View File

@ -1365,4 +1365,24 @@ public class OracleDictionary
isJDBC4 = false;
}
}
@Override
public String getIsNullSQL(String colAlias, int colType) {
switch(colType) {
case Types.BLOB:
case Types.CLOB:
return String.format("length (%s) = 0", colAlias);
}
return super.getIsNullSQL(colAlias, colType);
}
@Override
public String getIsNotNullSQL(String colAlias, int colType) {
switch(colType) {
case Types.BLOB:
case Types.CLOB:
return String.format("length (%s) != 0 ", colAlias);
}
return super.getIsNotNullSQL(colAlias, colType);
}
}