mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#715 - isNull() expression on @OneToMany or @ManyToMany produces incorrect SQL - should translate this to be same as isEmpty() and result in exists subquery
This commit is contained in:
@@ -50,10 +50,17 @@ class IsEmptyExpression extends AbstractExpression {
|
||||
throw new IllegalStateException("Property [" + propName + "] not found");
|
||||
}
|
||||
|
||||
isEmptySql(request, prop, empty, propertyPath);
|
||||
}
|
||||
|
||||
/**
|
||||
* Append an exists subQuery for the property.
|
||||
*/
|
||||
static void isEmptySql(SpiExpressionRequest request, ElPropertyValue prop, boolean empty, String propertyPath) {
|
||||
|
||||
if (empty) {
|
||||
request.append("not ");
|
||||
}
|
||||
|
||||
request
|
||||
.append("exists (select 1 from ")
|
||||
.append(prop.getAssocIsEmpty(request, propertyPath))
|
||||
|
||||
Reference in New Issue
Block a user