getMaxLevel has refactored to simplify the code
This commit is contained in:
parent
2c743f647c
commit
caddc4d4d7
@ -716,12 +716,7 @@ public class DefaultEntityQueryRepository implements EntityQueryRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int getMaxLevel(int maxLevel) {
|
int getMaxLevel(int maxLevel) {
|
||||||
int level = maxLevel > 0 ? maxLevel : this.maxLevelAllowed;
|
return (maxLevel <= 0 || maxLevel > this.maxLevelAllowed) ? this.maxLevelAllowed : maxLevel;
|
||||||
if (level > this.maxLevelAllowed) {
|
|
||||||
log.debug("hierarchy level {} is reduced down to maxLevelAllowed {}", level, this.maxLevelAllowed);
|
|
||||||
return this.maxLevelAllowed;
|
|
||||||
}
|
|
||||||
return level;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getQueryTemplate(EntitySearchDirection direction) {
|
private String getQueryTemplate(EntitySearchDirection direction) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user