#1475 - @OneToOne child with @SoftDelete that is deleted is still loaded by parent

This commit is contained in:
rob bygrave
2018-08-27 21:35:00 +12:00
parent 2df2224286
commit 55a9ba7170
9 changed files with 218 additions and 21 deletions
@@ -1,6 +1,7 @@
package io.ebeaninternal.server.query;
import io.ebean.util.SplitName;
import io.ebeaninternal.api.SpiQuery;
import java.util.HashMap;
import java.util.HashSet;
@@ -17,6 +18,8 @@ class SqlTreeAlias {
private static final Pattern TABLE_ALIAS_REPLACE = Pattern.compile("${}", Pattern.LITERAL);
private final SpiQuery.TemporalMode temporalMode;
private int counter;
private int manyWhereCounter;
@@ -33,8 +36,9 @@ class SqlTreeAlias {
private final String rootTableAlias;
SqlTreeAlias(String rootTableAlias) {
SqlTreeAlias(String rootTableAlias, SpiQuery.TemporalMode temporalMode) {
this.rootTableAlias = rootTableAlias;
this.temporalMode = temporalMode;
}
/**
@@ -211,4 +215,8 @@ class SqlTreeAlias {
boolean isIncludeJoins() {
return !aliasMap.isEmpty() || !manyWhereAliasMap.isEmpty();
}
boolean isIncludeSoftDelete() {
return temporalMode == SpiQuery.TemporalMode.SOFT_DELETED;
}
}