mirror of
https://github.com/moparisthebest/JdbcMapper
synced 2024-11-25 18:32:18 -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 ArrayInList() {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String columnAppend() {
|
protected String columnAppend(final String columnName) {
|
||||||
return " = ANY(?)";
|
return "(" + columnName + " = ANY(?))";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected <T> Array toArray(final Connection conn, final Collection<T> values) throws SQLException {
|
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 {
|
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(
|
return values == null || values.isEmpty() ? InListObject.empty : new ArrayListObject(
|
||||||
columnName + columnAppend(),
|
columnAppend(columnName),
|
||||||
toArray(conn, values)
|
toArray(conn, values)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -37,8 +37,8 @@ public class OracleArrayInList extends ArrayInList {
|
|||||||
protected OracleArrayInList() {
|
protected OracleArrayInList() {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected String columnAppend() {
|
protected String columnAppend(final String columnName) {
|
||||||
return " IN(select column_value from table(?))";
|
return "(" + columnName + " IN(select column_value from table(?)))";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected <T> Array toArray(final Connection conn, final Collection<T> values) throws SQLException {
|
protected <T> Array toArray(final Connection conn, final Collection<T> values) throws SQLException {
|
||||||
|
Loading…
Reference in New Issue
Block a user