public void addAdditionalExpression(Expression theExpression) { // This change puts a null check into every call, but is printing additional // expressions in a meaningful order worth it? additionalExpression = (additionalExpression == null) ? theExpression : additionalExpression.and(theExpression); }
public void addAdditionalExpression(Expression theExpression) { // This change puts a null check into every call, but is printing additional // expressions in a meaningful order worth it? additionalExpression = (additionalExpression == null) ? theExpression : additionalExpression.and(theExpression); }
public void addAdditionalExpression(Expression theExpression) { // This change puts a null check into every call, but is printing additional // expressions in a meaningfull order worth it? additionalExpression = (additionalExpression == null) ? theExpression : additionalExpression.and(theExpression); }
/** * INTERNAL: * This method must be included in any locking policy. When given an * expression, this method will return a new expression with the optimistic * locking values included. The values are taken from the passed in database row. * This expression will be used in a delete call. */ public Expression buildUpdateExpression(DatabaseTable table, Expression mainExpression, AbstractRecord transRow, AbstractRecord modifyRow) { return mainExpression.and(buildExpression(table, transRow, modifyRow, mainExpression.getBuilder())); }
/** * INTERNAL: * When given an expression, this method will return a new expression with the optimistic * locking values included. The values are taken from the passed in database row. * This expression will be used in a delete call. */ public Expression buildDeleteExpression(DatabaseTable table, Expression mainExpression, AbstractRecord row) { return mainExpression.and(buildExpression(table, row, null, mainExpression.getBuilder())); }
/** * INTERNAL: * When given an expression, this method will return a new expression with the optimistic * locking values included. The values are taken from the passed in database row. * This expression will be used in a delete call. */ public Expression buildDeleteExpression(DatabaseTable table, Expression mainExpression, AbstractRecord row) { return mainExpression.and(buildExpression(table, row, null, mainExpression.getBuilder())); }
/** * INTERNAL: * This method must be included in any locking policy. When given an * expression, this method will return a new expression with the optimistic * locking values included. The values are taken from the passed in database row. * This expression will be used in a delete call. */ public Expression buildUpdateExpression(DatabaseTable table, Expression mainExpression, AbstractRecord transRow, AbstractRecord modifyRow) { return mainExpression.and(buildExpression(table, transRow, modifyRow, mainExpression.getBuilder())); }
/** * INTERNAL: * This method must be included in any locking policy. When given an * expression, this method will return a new expression with the optimistic * locking values included. The values are taken from the passed in database row. * This expression will be used in a delete call. */ public Expression buildUpdateExpression(DatabaseTable table, Expression mainExpression, AbstractRecord transRow, AbstractRecord modifyRow) { return mainExpression.and(buildExpression(table, transRow, modifyRow, mainExpression.getBuilder())); }
@Override public Expression getJoinCriteria(ObjectExpression context, Expression base) { Expression selectionCriteria = getSelectionCriteria(); Expression keySelectionCriteria = this.containerPolicy.getKeySelectionCriteria(); if (keySelectionCriteria != null) { selectionCriteria = selectionCriteria.and(keySelectionCriteria); } if (additionalJoinCriteria != null) { selectionCriteria = selectionCriteria.and(additionalJoinCriteria); } return context.getBaseExpression().twist(selectionCriteria, base); }
/** * INTERNAL: * When given an expression, this method will return a new expression with the optimistic * locking values included. The values are taken from the passed in database row. * This expression will be used in a delete call. */ public Expression buildDeleteExpression(DatabaseTable table, Expression mainExpression, AbstractRecord row) { return mainExpression.and(buildExpression(table, row, null, mainExpression.getBuilder())); }
/** * INTERNAL: * Adds to the passed expression a single relation table field joined to source field. * Used to extend pessimistic locking clause in source query. */ public Expression joinRelationTableField(Expression expression, Expression baseExpression) { return baseExpression.getField(this.sourceKeyFields.get(0)).equal(baseExpression.getTable(relationTable).getField(this.sourceRelationKeyFields.get(0))).and(expression); }
/** * INTERNAL: * Adds to the passed expression a single relation table field joined to source field. * Used to extend pessimistic locking clause in source query. */ public Expression joinRelationTableField(Expression expression, Expression baseExpression) { return baseExpression.getField(this.sourceKeyFields.get(0)).equal(baseExpression.getTable(relationTable).getField(this.sourceRelationKeyFields.get(0))).and(expression); }
/** * INTERNAL: * Adds to the passed expression a single relation table field joined to source field. * Used to extend pessimistic locking clause in source query. */ public Expression joinRelationTableField(Expression expression, Expression baseExpression) { return baseExpression.getField(this.sourceKeyFields.get(0)).equal(baseExpression.getTable(relationTable).getField(this.sourceRelationKeyFields.get(0))).and(expression); }
@Override public Expression getJoinCriteria(ObjectExpression context, Expression base) { Expression selectionCriteria = getSelectionCriteria(); if (additionalJoinCriteria != null) { selectionCriteria = selectionCriteria.and(additionalJoinCriteria); } return context.getBaseExpression().twist(selectionCriteria, base); }
/** * INTERNAL: * Returns the join criteria stored in the mapping selection query. This criteria * is used to read reference objects across the tables from the database. */ public Expression getJoinCriteria(QueryKeyExpression exp) { Expression selectionCriteria = getSelectionCriteria(); Expression keySelectionCriteria = containerPolicy.getKeySelectionCriteria(); if (keySelectionCriteria != null){ selectionCriteria = selectionCriteria.and(keySelectionCriteria); } return exp.getBaseExpression().twist(selectionCriteria, exp); }
/** * INTERNAL * Return a EclipseLink expression by 'AND'ing the expressions from the left and right nodes */ public Expression generateExpression(GenerationContext context) { // Get the left expression Expression whereClause = getLeft().generateExpression(context); // Or it with whatever the right expression is whereClause = whereClause.and(getRight().generateExpression(context)); // and return the expression... return whereClause; } }
/** * INTERNAL * Return a EclipseLink expression by 'AND'ing the expressions from the left and right nodes */ public Expression generateExpression(GenerationContext context) { // Get the left expression Expression whereClause = getLeft().generateExpression(context); // Or it with whatever the right expression is whereClause = whereClause.and(getRight().generateExpression(context)); // and return the expression... return whereClause; } }
protected org.eclipse.persistence.expressions.Expression internalCorrelate(FromImpl from){ org.eclipse.persistence.expressions.Expression expression = ((InternalSelection)from).getCurrentNode(); ExpressionBuilder builder = new ExpressionBuilder(expression.getBuilder().getQueryClass()); org.eclipse.persistence.expressions.Expression correlated = expression.rebuildOn(builder); expression = expression.equal(correlated); this.correlations.add(expression); org.eclipse.persistence.expressions.Expression selectionCriteria = expression.and(this.subQuery.getSelectionCriteria()); this.subQuery.setSelectionCriteria(selectionCriteria); return correlated; }
/** * INTERNAL: * Selection criteria is created to read target records (nested table) from the table. */ protected void initializeSelectionCriteria(AbstractSession session) { Expression exp1; Expression exp2; ExpressionBuilder builder = new ExpressionBuilder(); Expression queryKey = builder.getManualQueryKey(getAttributeName(), getDescriptor()); exp1 = builder.ref().equal(queryKey.get(getAttributeName()).value()); exp2 = getDescriptor().getObjectBuilder().getPrimaryKeyExpression().rebuildOn(queryKey); setSelectionCriteria(exp1.and(exp2)); }
/** * INTERNAL: * Selection criteria is created to read target records (nested table) from the table. **/ protected void initializeSelectionCriteria(AbstractSession session) { Expression exp1; Expression exp2; ExpressionBuilder builder = new ExpressionBuilder(); Expression queryKey = builder.getManualQueryKey(getAttributeName(), getDescriptor()); exp1 = builder.ref().equal(queryKey.get(getAttributeName()).value()); exp2 = getDescriptor().getObjectBuilder().getPrimaryKeyExpression().rebuildOn(queryKey); setSelectionCriteria(exp1.and(exp2)); }