/** * Returns a safe clone * @see java.lang.Object#clone() */ public Object clone() { QueryCommand copyCommand = null; if(getCommand() != null) { copyCommand = (QueryCommand) getCommand().clone(); } ScalarSubquery clone = new ScalarSubquery(copyCommand); //Don't invoke the lazy-loading getType() clone.setType(this.type); clone.shouldEvaluate = this.shouldEvaluate; if (this.subqueryHint != null) { clone.subqueryHint = subqueryHint.clone(); } return clone; }
/** * Returns a safe clone * @see java.lang.Object#clone() */ public Object clone() { QueryCommand copyCommand = null; if(getCommand() != null) { copyCommand = (QueryCommand) getCommand().clone(); } ScalarSubquery clone = new ScalarSubquery(copyCommand); //Don't invoke the lazy-loading getType() clone.setType(this.type); clone.shouldEvaluate = this.shouldEvaluate; if (this.subqueryHint != null) { clone.subqueryHint = subqueryHint.clone(); } return clone; }
/** * Returns a safe clone * @see java.lang.Object#clone() */ public Object clone() { QueryCommand copyCommand = null; if(getCommand() != null) { copyCommand = (QueryCommand) getCommand().clone(); } ScalarSubquery clone = new ScalarSubquery(copyCommand); //Don't invoke the lazy-loading getType() clone.setType(this.type); clone.shouldEvaluate = this.shouldEvaluate; if (this.subqueryHint != null) { clone.subqueryHint = subqueryHint.clone(); } return clone; }
public static void setTypeIfNull(Expression symbol, Class<?> replacement) { if(!DataTypeManager.DefaultDataClasses.NULL.equals(symbol.getType()) && symbol.getType() != null) { return; } symbol = SymbolMap.getExpression(symbol); if(symbol instanceof Constant) { ((Constant)symbol).setType(replacement); } else if (symbol instanceof AbstractCaseExpression) { ((AbstractCaseExpression)symbol).setType(replacement); } else if (symbol instanceof ScalarSubquery) { ((ScalarSubquery)symbol).setType(replacement); } else if(symbol instanceof ElementSymbol) { ElementSymbol elementSymbol = (ElementSymbol)symbol; elementSymbol.setType(replacement); } else { try { ResolverUtil.setDesiredType(symbol, replacement, symbol); } catch (QueryResolverException e) { //cannot happen } } }
public static void setTypeIfNull(Expression symbol, Class<?> replacement) { if(!DataTypeManager.DefaultDataClasses.NULL.equals(symbol.getType()) && symbol.getType() != null) { return; } symbol = SymbolMap.getExpression(symbol); if(symbol instanceof Constant) { ((Constant)symbol).setType(replacement); } else if (symbol instanceof AbstractCaseExpression) { ((AbstractCaseExpression)symbol).setType(replacement); } else if (symbol instanceof ScalarSubquery) { ((ScalarSubquery)symbol).setType(replacement); } else if(symbol instanceof ElementSymbol) { ElementSymbol elementSymbol = (ElementSymbol)symbol; elementSymbol.setType(replacement); } else { try { ResolverUtil.setDesiredType(symbol, replacement, symbol); } catch (QueryResolverException e) { //cannot happen } } }
public static org.teiid.query.sql.symbol.ScalarSubquery helpExample() { Query query = TestQueryImpl.helpExample(true); org.teiid.query.sql.symbol.ScalarSubquery ss = new org.teiid.query.sql.symbol.ScalarSubquery(query); ss.setType(((Expression)query.getProjectedSymbols().get(0)).getType()); return ss; }
public static void setTypeIfNull(Expression symbol, Class<?> replacement) { if(!DataTypeManager.DefaultDataClasses.NULL.equals(symbol.getType()) && symbol.getType() != null) { return; } symbol = SymbolMap.getExpression(symbol); if(symbol instanceof Constant) { ((Constant)symbol).setType(replacement); } else if (symbol instanceof AbstractCaseExpression) { ((AbstractCaseExpression)symbol).setType(replacement); } else if (symbol instanceof ScalarSubquery) { ((ScalarSubquery)symbol).setType(replacement); } else if(symbol instanceof ElementSymbol) { ElementSymbol elementSymbol = (ElementSymbol)symbol; elementSymbol.setType(replacement); } else { try { ResolverUtil.setDesiredType(symbol, replacement, symbol); } catch (QueryResolverException e) { //cannot happen } } }