/** * INTERNAL: * Return the hash-code based on the unique selector. */ public int hashCode() { return getSelector(); }
/** * INTERNAL: * Return the hash-code based on the unique selector. */ public int hashCode() { return getSelector(); }
/** * INTERNAL: * Return the hash-code based on the unique selector. */ public int hashCode() { return getSelector(); }
/** * ADVANCED: * Add an operator to the global list of operators. */ public static void addOperator(ExpressionOperator exOperator) { allOperators.put(Integer.valueOf(exOperator.getSelector()), exOperator); }
/** * ADVANCED: * Add an operator to the global list of operators. */ public static void addOperator(ExpressionOperator exOperator) { allOperators.put(Integer.valueOf(exOperator.getSelector()), exOperator); }
/** * ADVANCED: * Add an operator to the global list of operators. */ public static void addOperator(ExpressionOperator exOperator) { allOperators.put(new Integer(exOperator.getSelector()), exOperator); }
protected void addOperator(ExpressionOperator operator) { platformOperators.put(Integer.valueOf(operator.getSelector()), operator); }
/** * INTERNAL: * Check if the object conforms to the expression in memory. * This is used for in-memory querying across object relationships. */ public boolean performSelector(boolean areValuesEqual) { if (this.operator.getSelector() == ExpressionOperator.Equal) { return areValuesEqual; } else if (this.operator.getSelector() == ExpressionOperator.NotEqual) { return !areValuesEqual; } else { throw QueryException.cannotConformExpression(); } }
/** * INTERNAL: * Check if the object conforms to the expression in memory. * This is used for in-memory querying across object relationships. */ public boolean performSelector(boolean areValuesEqual) { if (this.operator.getSelector() == ExpressionOperator.Equal) { return areValuesEqual; } else if (this.operator.getSelector() == ExpressionOperator.NotEqual) { return !areValuesEqual; } else { throw QueryException.cannotConformExpression(); } }
private void addFunction(Map<Integer, ExpressionOperator> platformOperators, String name, JpqlFunction function, AbstractSession session, Map<Class<?>, String> classTypes) { ExpressionOperator operator = createOperator(name, function, session, classTypes); ExpressionOperator.registerOperator(operator.getSelector(), operator.getName()); ExpressionOperator.addOperator(operator); platformOperators.put(Integer.valueOf(operator.getSelector()), operator); }
private void addFunction(Map<Integer, ExpressionOperator> platformOperators, String name, JpqlFunction function, AbstractSession session, Map<Class<?>, String> classTypes) { ExpressionOperator operator = createOperator(name, function, session, classTypes); ExpressionOperator.registerOperator(operator.getSelector(), operator.getName()); ExpressionOperator.addOperator(operator); platformOperators.put(Integer.valueOf(operator.getSelector()), operator); }
/** * INTERNAL: * Check if the object conforms to the expression in memory. * This is used for in-memory querying. * If the expression in not able to determine if the object conform throw a not supported exception. */ public boolean doesConform(Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean objectIsUnregistered) { // This should always be and or or. if (this.operator.getSelector() == ExpressionOperator.And) { return this.firstChild.doesConform(object, session, translationRow, valueHolderPolicy, objectIsUnregistered) && this.secondChild.doesConform(object, session, translationRow, valueHolderPolicy, objectIsUnregistered); } else if (this.operator.getSelector() == ExpressionOperator.Or) { return this.firstChild.doesConform(object, session, translationRow, valueHolderPolicy, objectIsUnregistered) || this.secondChild.doesConform(object, session, translationRow, valueHolderPolicy, objectIsUnregistered); } throw QueryException.cannotConformExpression(); }
/** * INTERNAL: * Modify this individual expression node to use outer joins wherever there are * equality operations between two field nodes. */ protected void convertNodeToUseOuterJoin() { if ((this.operator.getSelector() == ExpressionOperator.Equal) && allChildrenAreFields()) { setOperator(getOperator(ExpressionOperator.EqualOuterJoin)); } }
/** * INTERNAL: * Modify this individual expression node to use outer joins wherever there are * equality operations between two field nodes. */ protected void convertNodeToUseOuterJoin() { if ((this.operator.getSelector() == ExpressionOperator.Equal) && allChildrenAreFields()) { setOperator(getOperator(ExpressionOperator.EqualOuterJoin)); } }
/** * INTERNAL: * Modify this individual expression node to use outer joins wherever there are * equality operations between two field nodes. */ protected void convertNodeToUseOuterJoin() { if ((this.operator.getSelector() == ExpressionOperator.Equal) && allChildrenAreFields()) { setOperator(getOperator(ExpressionOperator.EqualOuterJoin)); } }
/** * INTERNAL: */ public void initializePlatformOperator(DatabasePlatform platform) { if (this.operator.isComplete()) { platformOperator = this.operator; return; } platformOperator = platform.getOperator(this.operator.getSelector()); if (platformOperator == null) { throw QueryException.invalidOperator(this.operator.toString()); } }
/** * INTERNAL: */ public void initializePlatformOperator(DatabasePlatform platform) { if (this.operator.isComplete()) { platformOperator = this.operator; return; } platformOperator = platform.getOperator(this.operator.getSelector()); if (platformOperator == null) { throw QueryException.invalidOperator(this.operator.toString()); } }
/** * Print a debug representation of this operator. */ public String toString() { if ((getDatabaseStrings() == null) || (getDatabaseStrings().length == 0)) { //CR#... Print a useful name for the missing plaftorm operator. return "platform operator - " + getPlatformOperatorName(getSelector()); } else { return "operator " + getDatabaseStrings()[0]; } }
/** * INTERNAL: */ public void initializePlatformOperator(DatabasePlatform platform) { if (this.operator.isComplete()) { platformOperator = this.operator; return; } platformOperator = platform.getOperator(this.operator.getSelector()); if (platformOperator == null) { throw QueryException.invalidOperator(this.operator.toString()); } }
/** * INTERNAL: */ public void initializePlatformOperator(DatabasePlatform platform) { if (this.operator.isComplete()) { platformOperator = this.operator; return; } platformOperator = platform.getOperator(this.operator.getSelector()); if (platformOperator == null) { throw QueryException.invalidOperator(this.operator.toString()); } }