/** * @since 3.0 */ @Override @SuppressWarnings("unchecked") public PathComponent<ObjAttribute, ObjRelationship> lastPathComponent(Expression path, Map aliasMap) { return super.lastPathComponent(path, aliasMap); }
/** * @since 3.0 */ @Override @SuppressWarnings("unchecked") public PathComponent<DbAttribute, DbRelationship> lastPathComponent(Expression path, Map aliasMap) { return super.lastPathComponent(path, aliasMap); }
/** * Convenience method returning the last component in the path iterator. If the last * component is an alias, it is fully resolved down to the last ObjRelationship. * * @since 3.0 */ @SuppressWarnings("unchecked") public <T extends Attribute, U extends Relationship> PathComponent<T, U> lastPathComponent( Expression path, Map aliasMap) { for (PathComponent component : resolvePath(path, aliasMap)) { if (component.isLast()) { // resolve aliases if needed return lastPathComponent(component); } } return null; }
@SuppressWarnings("unchecked") private PathComponent lastPathComponent(PathComponent<Attribute, Relationship> component) { if (!component.isAlias()) { return component; } for (PathComponent subcomponent : component.getAliasedPath()) { if (subcomponent.isLast()) { return lastPathComponent(subcomponent); } } throw new IllegalStateException("Invalid last path component: " + component.getName()); }
PathComponent<ObjAttribute, ObjRelationship> component = ((Entity) root).lastPathComponent( (ASTObjPath) operand, null); ObjAttribute attribute = component.getAttribute();
PathComponent<ObjAttribute, ObjRelationship> component = ((Entity) root).lastPathComponent((ASTObjPath) operand, null); ObjAttribute attribute = component.getAttribute(); if (attribute != null) {