mirror of
https://github.com/moparisthebest/JdbcMapper
synced 2024-12-22 07:18:51 -05:00
Have InList sql always be wrapped by parens
This commit is contained in:
parent
430b4eab76
commit
95dcf6722c
@ -19,8 +19,8 @@ public class ArrayInList implements InList {
|
||||
protected ArrayInList() {
|
||||
}
|
||||
|
||||
protected String columnAppend() {
|
||||
return " = ANY(?)";
|
||||
protected String columnAppend(final String columnName) {
|
||||
return "(" + columnName + " = ANY(?))";
|
||||
}
|
||||
|
||||
protected <T> Array toArray(final Connection conn, final Collection<T> values) throws SQLException {
|
||||
@ -32,7 +32,7 @@ public class ArrayInList implements InList {
|
||||
|
||||
public <T> InListObject inList(final Connection conn, final String columnName, final Collection<T> values) throws SQLException {
|
||||
return values == null || values.isEmpty() ? InListObject.empty : new ArrayListObject(
|
||||
columnName + columnAppend(),
|
||||
columnAppend(columnName),
|
||||
toArray(conn, values)
|
||||
);
|
||||
}
|
||||
|
@ -37,8 +37,8 @@ public class OracleArrayInList extends ArrayInList {
|
||||
protected OracleArrayInList() {
|
||||
}
|
||||
|
||||
protected String columnAppend() {
|
||||
return " IN(select column_value from table(?))";
|
||||
protected String columnAppend(final String columnName) {
|
||||
return "(" + columnName + " IN(select column_value from table(?)))";
|
||||
}
|
||||
|
||||
protected <T> Array toArray(final Connection conn, final Collection<T> values) throws SQLException {
|
||||
|
Loading…
Reference in New Issue
Block a user