/** * Returns an alias that uniquely identifies the last collection of entities in the path. * @return An alias for the path. */ public String getAlias() { if (pathElements.size() < 2) { return lastElement() .map(e -> getTypeAlias(e.getType())) .orElse(null); } PathElement previous = pathElements.get(pathElements.size() - 2); return getTypeAlias(previous.getType()) + UNDERSCORE + previous.getFieldName(); }
/** * Returns an alias that uniquely identifies the last collection of entities in the path. * @return An alias for the path. */ public String getAlias() { if (pathElements.size() < 2) { return lastElement() .map(e -> getTypeAlias(e.getType())) .orElse(null); } PathElement previous = pathElements.get(pathElements.size() - 2); return getTypeAlias(previous.getType()) + UNDERSCORE + previous.getFieldName(); }
Path path = entry.getKey(); String prefix = (prefixWithAlias) ? Path.getTypeAlias(sortClass) + PERIOD : "";