DatabaseQuery applyToDatabaseQuery(Object valueToApply, DatabaseQuery query, ClassLoader loader, AbstractSession activeSession) { if (query.isObjectLevelReadQuery()) { ((ObjectLevelReadQuery) query).setAsOfClause(new AsOfSCNClause(QueryHintsHandler.parseIntegerHint(valueToApply, QueryHints.AS_OF_SCN))); } else { throw new IllegalArgumentException(ExceptionLocalization.buildMessage("ejb30-wrong-type-for-query-hint",new Object[]{getQueryId(query), name, getPrintValue(valueToApply)})); } return query; } }
/** * INTERNAL: * Prints the as of clause for an expression inside of the FROM clause. */ public void printSQL(ExpressionSQLPrinter printer) { printer.printString("AS OF SCN ("); Object value = getValue(); if (value instanceof Expression) { // Sort of an implementation of native sql. // Print AS OF SCN (1000L - 45L) not AS OF ('1000L - 45L'). if ((value instanceof ConstantExpression) && (((ConstantExpression)value).getValue() instanceof String)) { printer.printString((String)((ConstantExpression)value).getValue()); } else { printer.printExpression((Expression)value); } } else { ConversionManager converter = ConversionManager.getDefaultManager(); value = converter.convertObject(value, ClassConstants.LONG); printer.printPrimitive(value); } printer.printString(")"); }
/** * INTERNAL: * Prints the as of clause for an expression inside of the FROM clause. */ public void printSQL(ExpressionSQLPrinter printer) { printer.printString("AS OF SCN ("); Object value = getValue(); if (value instanceof Expression) { // Sort of an implementation of native sql. // Print AS OF SCN (1000L - 45L) not AS OF ('1000L - 45L'). if ((value instanceof ConstantExpression) && (((ConstantExpression)value).getValue() instanceof String)) { printer.printString((String)((ConstantExpression)value).getValue()); } else { printer.printExpression((Expression)value); } } else { ConversionManager converter = ConversionManager.getDefaultManager(); value = converter.convertObject(value, ClassConstants.LONG); printer.printPrimitive(value); } printer.printString(")"); }
/** * INTERNAL: * Prints the as of clause for an expression inside of the FROM clause. */ public void printSQL(ExpressionSQLPrinter printer) { printer.printString("AS OF SCN ("); Object value = getValue(); if (value instanceof Expression) { // Sort of an implementation of native sql. // Print AS OF SCN (1000L - 45L) not AS OF ('1000L - 45L'). if ((value instanceof ConstantExpression) && (((ConstantExpression)value).getValue() instanceof String)) { printer.printString((String)((ConstantExpression)value).getValue()); } else { printer.printExpression((Expression)value); } } else { ConversionManager converter = ConversionManager.getDefaultManager(); value = converter.convertObject(value, ClassConstants.LONG); printer.printPrimitive(value); } printer.printString(")"); }
/** * {@inheritDoc} */ @Override public void visit(AsOfClause expression) { Expression queryExpression = queryContext.buildExpression(expression); org.eclipse.persistence.history.AsOfClause asOfClause; if (expression.hasScn()) { asOfClause = new AsOfSCNClause(queryExpression); } else { asOfClause = new org.eclipse.persistence.history.AsOfClause(queryExpression); } query.setAsOfClause(asOfClause); query.setShouldMaintainCache(false); }
/** * {@inheritDoc} */ @Override public void visit(AsOfClause expression) { Expression queryExpression = queryContext.buildExpression(expression); org.eclipse.persistence.history.AsOfClause asOfClause; if (expression.hasScn()) { asOfClause = new AsOfSCNClause(queryExpression); } else { asOfClause = new org.eclipse.persistence.history.AsOfClause(queryExpression); } query.setAsOfClause(asOfClause); query.setShouldMaintainCache(false); }