mirror of https://github.com/apache/openjpa.git
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:
parent
75bbc90899
commit
005a18a739
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue