/** * Returns an Iterable instance over expression path components based on * this entity. * * @since 3.0 */ @Override @SuppressWarnings("unchecked") public Iterable<PathComponent<DbAttribute, DbRelationship>> resolvePath(final Expression pathExp, final Map aliasMap) { if (pathExp.getType() == Expression.DB_PATH) { return new Iterable<PathComponent<DbAttribute, DbRelationship>>() { public Iterator iterator() { return new PathComponentIterator(DbEntity.this, (String) pathExp.getOperand(0), aliasMap); } }; } throw new ExpressionException("Invalid expression type: '" + pathExp.expName() + "', DB_PATH is expected."); }
/** * Returns an Iterable instance over expression path components based on * this entity. * * @since 3.0 */ @Override @SuppressWarnings("unchecked") public Iterable<PathComponent<ObjAttribute, ObjRelationship>> resolvePath(final Expression pathExp, final Map aliasMap) { if (pathExp.getType() == Expression.OBJ_PATH) { return new Iterable<PathComponent<ObjAttribute, ObjRelationship>>() { public Iterator iterator() { return new PathComponentIterator(ObjEntity.this, (String) pathExp.getOperand(0), aliasMap); } }; } throw new ExpressionException("Invalid expression type: '" + pathExp.expName() + "', OBJ_PATH is expected."); }
@Override public Iterator<CayenneMapEntry> resolvePathComponents(Expression pathExp) throws ExpressionException { if (pathExp.getType() != Expression.DB_PATH) { throw new ExpressionException("Invalid expression type: '" + pathExp.expName() + "', DB_PATH is expected."); } return new PathIterator((String) pathExp.getOperand(0)); }
public Iterator resolvePathComponents(Expression pathExp) throws ExpressionException { if (pathExp.getType() != Expression.DB_PATH) { throw new ExpressionException("Invalid expression type: '" + pathExp.expName() + "', DB_PATH is expected."); } return new PathIterator((String) pathExp.getOperand(0)); }
@Override public Iterator<CayenneMapEntry> resolvePathComponents(Expression pathExp) throws ExpressionException { // resolve DB_PATH if we can if (pathExp.getType() == Expression.DB_PATH) { if (getDbEntity() == null) { throw new ExpressionException("Can't resolve DB_PATH '" + pathExp + "', DbEntity is not set."); } return getDbEntity().resolvePathComponents(pathExp); } if (pathExp.getType() == Expression.OBJ_PATH) { return new PathIterator((String) pathExp.getOperand(0)); } throw new ExpressionException("Invalid expression type: '" + pathExp.expName() + "', OBJ_PATH is expected."); }
public Iterator resolvePathComponents(Expression pathExp) throws ExpressionException { // resolve DB_PATH if we can if (pathExp.getType() == Expression.DB_PATH) { if (getDbEntity() == null) { throw new ExpressionException("Can't resolve DB_PATH '" + pathExp + "', DbEntity is not set."); } return getDbEntity().resolvePathComponents(pathExp); } if (pathExp.getType() == Expression.OBJ_PATH) { return new PathIterator((String) pathExp.getOperand(0)); } throw new ExpressionException("Invalid expression type: '" + pathExp.expName() + "', OBJ_PATH is expected."); }
for(Property<?> column : query.getColumns()) { Expression exp = column.getExpression(); String name = column.getName() == null ? exp.expName() : column.getName(); boolean fullObject = false; if(exp.getType() == Expression.OBJ_PATH) {
+ expression.getType() + " (" + expression.expName() + ")");