2018-05-15 23:32:00 -04:00
|
|
|
package com.moparisthebest.jdbc;
|
|
|
|
|
2018-05-20 12:51:37 -04:00
|
|
|
import com.moparisthebest.jdbc.codegen.JdbcMapper;
|
|
|
|
|
2018-05-15 23:32:00 -04:00
|
|
|
/**
|
|
|
|
* HSQLDB requires array in lists to be implemented this way:
|
|
|
|
* https://stackoverflow.com/questions/35939489/createarrayof-string-in-hsqldb-jdbc-returns-abstractmethoderror/35964424#35964424
|
|
|
|
*/
|
|
|
|
public class UnNestArrayInList extends ArrayInList {
|
|
|
|
|
|
|
|
private static final InList instance = new UnNestArrayInList();
|
|
|
|
|
|
|
|
public static InList instance() {
|
|
|
|
return instance;
|
|
|
|
}
|
|
|
|
|
|
|
|
public UnNestArrayInList(final String numberType, final String otherType) {
|
|
|
|
super(numberType, otherType);
|
|
|
|
}
|
|
|
|
|
|
|
|
public UnNestArrayInList() {
|
2018-05-20 12:51:37 -04:00
|
|
|
this(JdbcMapper.DatabaseType.UNNEST.arrayNumberTypeName, JdbcMapper.DatabaseType.UNNEST.arrayStringTypeName);
|
2018-05-15 23:32:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
protected String columnAppend(final String columnName) {
|
|
|
|
return "(" + columnName + " IN(UNNEST(?)))";
|
|
|
|
}
|
|
|
|
}
|