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 level = maxLevel > 0 ? maxLevel : this.maxLevelAllowed;
|
||||
if (level > this.maxLevelAllowed) {
|
||||
log.debug("hierarchy level {} is reduced down to maxLevelAllowed {}", level, this.maxLevelAllowed);
|
||||
return this.maxLevelAllowed;
|
||||
}
|
||||
return level;
|
||||
return (maxLevel <= 0 || maxLevel > this.maxLevelAllowed) ? this.maxLevelAllowed : maxLevel;
|
||||
}
|
||||
|
||||
private String getQueryTemplate(EntitySearchDirection direction) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user