diff --git a/beehive-jdbc-mapper/src/main/java/com/moparisthebest/jdbc/ArrayInList.java b/beehive-jdbc-mapper/src/main/java/com/moparisthebest/jdbc/ArrayInList.java index 1ddb63b..17c5a1e 100644 --- a/beehive-jdbc-mapper/src/main/java/com/moparisthebest/jdbc/ArrayInList.java +++ b/beehive-jdbc-mapper/src/main/java/com/moparisthebest/jdbc/ArrayInList.java @@ -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 Array toArray(final Connection conn, final Collection values) throws SQLException { @@ -32,7 +32,7 @@ public class ArrayInList implements InList { public InListObject inList(final Connection conn, final String columnName, final Collection values) throws SQLException { return values == null || values.isEmpty() ? InListObject.empty : new ArrayListObject( - columnName + columnAppend(), + columnAppend(columnName), toArray(conn, values) ); } diff --git a/beehive-jdbc-mapper/src/main/java/com/moparisthebest/jdbc/OracleArrayInList.java b/beehive-jdbc-mapper/src/main/java/com/moparisthebest/jdbc/OracleArrayInList.java index f78263a..542d61e 100644 --- a/beehive-jdbc-mapper/src/main/java/com/moparisthebest/jdbc/OracleArrayInList.java +++ b/beehive-jdbc-mapper/src/main/java/com/moparisthebest/jdbc/OracleArrayInList.java @@ -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 Array toArray(final Connection conn, final Collection values) throws SQLException {