public ExpressionOperator getPlatformOperator(DatabasePlatform platform) { if (platformOperator == null) { initializePlatformOperator(platform); } return platformOperator; }
/** * INTERNAL: */ @Override public Expression create(Expression base, List arguments, ExpressionOperator operator) { setFirstChild(base); if (!arguments.isEmpty()) { setSecondChild((Expression)arguments.get(0)); } setOperator(operator); return this; }
/** * INTERNAL: * Used for cloning. */ protected void postCopyIn(Map alreadyDone) { super.postCopyIn(alreadyDone); if (this.firstChild != null) { setFirstChild(this.firstChild.copiedVersionFrom(alreadyDone)); } if (this.secondChild != null) { setSecondChild(this.secondChild.copiedVersionFrom(alreadyDone)); } }
validateNode(); boolean previous = normalizer.isAddAdditionalExpressionsWithinCurrrentExpressionContext(); boolean isOrExpression = (isLogicalExpression() && this.operator.getSelector() == ExpressionOperator.Or); normalizer.setAddAdditionalExpressionsWithinCurrrentExpressionContext(previous|| isOrExpression); builder.setSession(normalizer.getSession().getRootSession(null)); setFirstChild(normalizer.processAdditionalLocalExpressions(this.firstChild.normalize(normalizer), isOrExpression)); builder.setSession(normalizer.getSession().getRootSession(null)); setSecondChild(normalizer.processAdditionalLocalExpressions(this.secondChild.normalize(normalizer), isOrExpression));
if(expression instanceof CompoundExpression) { CompoundExpression ce = (CompoundExpression)expression; tables.addAll(mapTableIndexToExpression(ce.getFirstChild(), map, tablesInOrder)); tables.addAll(mapTableIndexToExpression(ce.getSecondChild(), map, tablesInOrder)); } else if(expression instanceof FunctionExpression) { FunctionExpression fe = (FunctionExpression)expression;
validateNode(); if (this.firstChild != null) { builder.setSession(normalizer.getSession().getRootSession(null)); setFirstChild(this.firstChild.normalize(normalizer)); builder.setSession(normalizer.getSession().getRootSession(null)); setSecondChild(this.secondChild.normalize(normalizer));
if (this.parentNode.isCompoundExpression()) { CompoundExpression logExp = (LogicalExpression) this.parentNode; if (logExp.getFirstChild() == baseIn) { logExp.create(this.currentNode, logExp.getSecondChild(), logExp.getOperator()); } else { logExp.create(logExp.getFirstChild(), this.currentNode, logExp.getOperator());
/** * INTERNAL: * Print java for project class generation */ public void printJava(ExpressionJavaPrinter printer) { ExpressionOperator realOperator = getPlatformOperator(printer.getPlatform()); realOperator.printJavaDuo(this.firstChild, this.secondChild, printer); }
/** * INTERNAL: * Print SQL */ public void printSQL(ExpressionSQLPrinter printer) { // If both sides are parameters, some databases don't allow binding. if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && ((this.firstChild.isParameterExpression() || this.firstChild.isConstantExpression()) && (this.secondChild.isParameterExpression() || this.secondChild.isConstantExpression()))) { printer.getCall().setUsesBinding(false); } if (isEqualNull(printer)) { this.firstChild.isNull().printSQL(printer); } else if (isNotEqualNull(printer)) { this.firstChild.notNull().printSQL(printer); } else { super.printSQL(printer); } }
DatabaseTable newAlias = relationExpression.aliasForTable(newTarget); writer.write(", OUTER ");// need to outer join only to relation table for many-to-many case in Informix writer.write(newTarget.getQualifiedNameDelimited(printer.getPlatform())); } else if (outerExpression.getMapping().isDirectCollectionMapping()) {// for many to many mappings, you need to do some funky stuff to get the relation table's alias DatabaseTable newTarget = ((DirectCollectionMapping)outerExpression.getMapping()).getReferenceTable(); DatabaseTable newAlias = relationExpression.aliasForTable(newTarget); writer.write(", OUTER "); writer.write(newTarget.getQualifiedNameDelimited(printer.getPlatform()));
validateNode(); boolean previous = normalizer.isAddAdditionalExpressionsWithinCurrrentExpressionContext(); boolean isOrExpression = (isLogicalExpression() && this.operator.getSelector() == ExpressionOperator.Or); normalizer.setAddAdditionalExpressionsWithinCurrrentExpressionContext(previous|| isOrExpression); builder.setSession(normalizer.getSession().getRootSession(null)); setFirstChild(normalizer.processAdditionalLocalExpressions(this.firstChild.normalize(normalizer), isOrExpression)); builder.setSession(normalizer.getSession().getRootSession(null)); setSecondChild(normalizer.processAdditionalLocalExpressions(this.secondChild.normalize(normalizer), isOrExpression));
if(expression instanceof CompoundExpression) { CompoundExpression ce = (CompoundExpression)expression; tables.addAll(mapTableIndexToExpression(ce.getFirstChild(), map, tablesInOrder)); tables.addAll(mapTableIndexToExpression(ce.getSecondChild(), map, tablesInOrder)); } else if(expression instanceof FunctionExpression) { FunctionExpression fe = (FunctionExpression)expression;
/** * INTERNAL: * Used for cloning. */ protected void postCopyIn(Map alreadyDone) { super.postCopyIn(alreadyDone); if (this.firstChild != null) { setFirstChild(this.firstChild.copiedVersionFrom(alreadyDone)); } if (this.secondChild != null) { setSecondChild(this.secondChild.copiedVersionFrom(alreadyDone)); } }
/** * INTERNAL: * Print java for project class generation */ public void printJava(ExpressionJavaPrinter printer) { ExpressionOperator realOperator = getPlatformOperator(printer.getPlatform()); realOperator.printJavaDuo(this.firstChild, this.secondChild, printer); }
/** * INTERNAL: * Print SQL */ public void printSQL(ExpressionSQLPrinter printer) { // If both sides are parameters, some databases don't allow binding. if (printer.getPlatform().isDynamicSQLRequiredForFunctions() && ((this.firstChild.isParameterExpression() || this.firstChild.isConstantExpression()) && (this.secondChild.isParameterExpression() || this.secondChild.isConstantExpression()))) { printer.getCall().setUsesBinding(false); } if (isEqualNull(printer)) { this.firstChild.isNull().printSQL(printer); } else if (isNotEqualNull(printer)) { this.firstChild.notNull().printSQL(printer); } else { super.printSQL(printer); } }
DatabaseTable newAlias = relationExpression.aliasForTable(newTarget); writer.write(", OUTER ");// need to outer join only to relation table for many-to-many case in Informix writer.write(newTarget.getQualifiedNameDelimited(printer.getPlatform())); } else if (outerExpression.getMapping().isDirectCollectionMapping()) {// for many to many mappings, you need to do some funky stuff to get the relation table's alias DatabaseTable newTarget = ((DirectCollectionMapping)outerExpression.getMapping()).getReferenceTable(); DatabaseTable newAlias = relationExpression.aliasForTable(newTarget); writer.write(", OUTER "); writer.write(newTarget.getQualifiedNameDelimited(printer.getPlatform()));
/** * INTERNAL: */ @Override public Expression create(Expression base, List arguments, ExpressionOperator operator) { setFirstChild(base); if (!arguments.isEmpty()) { setSecondChild((Expression)arguments.get(0)); } setOperator(operator); return this; }
if(expression instanceof CompoundExpression) { CompoundExpression ce = (CompoundExpression)expression; tables.addAll(mapTableIndexToExpression(ce.getFirstChild(), map, tablesInOrder)); tables.addAll(mapTableIndexToExpression(ce.getSecondChild(), map, tablesInOrder)); } else if(expression instanceof FunctionExpression) { FunctionExpression fe = (FunctionExpression)expression;