} else if (trimmedPath.regionMatches(true, 0, keyStart, 0, keyStart.length())) { collectionArgumentStart = keyStart.length(); collectionFunction = new MapKeyAttribute<>(type.getMap(collectionName)); } else { int dotIndex = trimmedPath.indexOf('.');
} else if (trimmedPath.regionMatches(true, 0, keyStart, 0, keyStart.length())) { collectionArgumentStart = keyStart.length(); collectionFunction = new MapKeyAttribute<>(type.getMap(collectionName)); } else { int dotIndex = trimmedPath.indexOf('.');
@Override public void visit(MapKeyExpression expression) { expression.getPath().accept(this); currentPosition.setAttribute(new MapKeyAttribute<>((MapAttribute<?, Object, ?>) currentPosition.getAttribute())); currentPosition.setValueType(null); }
@Override public void visit(MapKeyExpression expression) { expression.getPath().accept(this); currentPosition.setAttribute(new MapKeyAttribute<>((MapAttribute<?, Object, ?>) currentPosition.getAttribute())); currentPosition.setValueType(null); }
@Override public void visit(MapKeyExpression expression) { expression.getPath().accept(this); if (!(currentPosition.getAttribute() instanceof MapAttribute<?, ?, ?>)) { invalid(expression, "Does not resolve to java.util.Map!"); } else { currentPosition.setAttribute(new MapKeyAttribute<>((MapAttribute<?, Object, ?>) currentPosition.getAttribute())); currentPosition.setCurrentType(((MapAttribute<?, Object, ?>) currentPosition.getAttribute()).getKeyType()); } }
private JoinNode joinMapKey(MapKeyExpression mapKeyExpression, String alias, ClauseType fromClause, Set<String> currentlyResolvingAliases, boolean fromSubquery, boolean fromSelectAlias, boolean joinRequired, boolean fetch, boolean implicit, boolean defaultJoin) { implicitJoin(mapKeyExpression.getPath(), true, true, null, fromClause, null, currentlyResolvingAliases, fromSubquery, fromSelectAlias, joinRequired, false, fetch, false); JoinNode current = (JoinNode) mapKeyExpression.getPath().getBaseNode(); String joinRelationName = "KEY(" + current.getParentTreeNode().getRelationName() + ")"; MapAttribute<?, ?, ?> mapAttribute = (MapAttribute<?, ?, ?>) current.getParentTreeNode().getAttribute(); Attribute<?, ?> keyAttribute = new MapKeyAttribute<>(mapAttribute); String aliasToUse = alias == null ? current.getParentTreeNode().getRelationName().replaceAll("\\.", "_") + "_key" : alias; Type<?> joinRelationType = metamodel.type(mapAttribute.getKeyJavaType()); current = getOrCreate(current, joinRelationName, joinRelationType, null, aliasToUse, JoinType.LEFT, "Ambiguous implicit join", implicit, true, keyAttribute); return current; }