mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-20 07:03:22 +00:00
#1186 - ENH: Support using TableValues / Array for select prop in (?) queries
Use Postgres Array ANY and ALL without select unnest
This commit is contained in:
1 parent
5bccdccbd6
commit
1e1c518641
34 files changed
+157
-117
No files matched your search
@@ -153,7 +153,7 @@ public interface IdBinder {
|
||||
/**
|
||||
* Return the binding expression (like "?" or "(?,?)")for the Id.
|
||||
*/
|
||||
String getIdInValueExpr(int size);
|
||||
String getIdInValueExpr(boolean not, int size);
|
||||
|
||||
/**
|
||||
* Same as getIdInValueExpr but for delete by id.
|
||||
|
||||
@@ -170,7 +170,7 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
throw new IndexOutOfBoundsException("The size must be at least 1");
|
||||
}
|
||||
if (!idInExpandedForm) {
|
||||
return getIdInValueExpr(size);
|
||||
return getIdInValueExpr(false, size);
|
||||
}
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
@@ -195,12 +195,14 @@ public final class IdBinderEmbedded implements IdBinder {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdInValueExpr(int size) {
|
||||
public String getIdInValueExpr(boolean not, int size) {
|
||||
if (size <= 0) {
|
||||
throw new IndexOutOfBoundsException("The size must be at least 1");
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
if (not) {
|
||||
sb.append(" not");
|
||||
}
|
||||
if (!idInExpandedForm) {
|
||||
sb.append(" in");
|
||||
}
|
||||
|
||||
@@ -88,11 +88,11 @@ public final class IdBinderEmpty implements IdBinder {
|
||||
|
||||
@Override
|
||||
public String getIdInValueExprDelete(int size) {
|
||||
return getIdInValueExpr(size);
|
||||
return getIdInValueExpr(false, size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdInValueExpr(int size) {
|
||||
public String getIdInValueExpr(boolean not, int size) {
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
@@ -133,15 +133,15 @@ public final class IdBinderSimple implements IdBinder {
|
||||
|
||||
@Override
|
||||
public String getIdInValueExprDelete(int size) {
|
||||
return getIdInValueExpr(size);
|
||||
return getIdInValueExpr(false, size);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdInValueExpr(int size) {
|
||||
public String getIdInValueExpr(boolean not, int size) {
|
||||
if (size <= 0) {
|
||||
throw new IndexOutOfBoundsException("The size must be at least 1");
|
||||
}
|
||||
return multiValueBind.getInExpression(scalarType, size);
|
||||
return multiValueBind.getInExpression(not, scalarType, size);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user