/** * Returns a value for the given id. */ protected Value getVariable(String id, boolean bind) { // check for already constructed var if (isSeenVariable(id)) return (Value) _seenVars.get(id); // create and cache var Class type = getDeclaredVariableType(id); // add this type to the set of classes in the filter's access path ClassMetaData meta = null; if (type == null) type = TYPE_OBJECT; else meta = getMetaData(type, false); if (meta != null) _accessPath.add(meta); Value var; if (bind) var = factory.newBoundVariable(id, type); else var = factory.newUnboundVariable(id, type); var.setMetaData(meta); if (_seenVars == null) _seenVars = new HashMap(); _seenVars.put(id, var); return var; }
/** * Convert this path to a kernel expression. * */ @Override public org.apache.openjpa.kernel.exps.Expression toKernelExpression( ExpressionFactory factory, CriteriaQueryImpl<?> c) { Value path = toValue(factory, c); Value var = factory.newBoundVariable(c.getAlias(this), _entity.meta.getDescribedType()); return factory.bindVariable(var, path); }
/** * Convert this path to a kernel expression. * */ @Override public org.apache.openjpa.kernel.exps.Expression toKernelExpression( ExpressionFactory factory, CriteriaQueryImpl<?> c) { Value path = toValue(factory, c); Value var = factory.newBoundVariable(c.getAlias(this), _entity.meta.getDescribedType()); return factory.bindVariable(var, path); }
/** * Convert this path to a kernel expression. * */ @Override public org.apache.openjpa.kernel.exps.Expression toKernelExpression( ExpressionFactory factory, CriteriaQueryImpl<?> c) { Value path = toValue(factory, c); Value var = factory.newBoundVariable(c.getAlias(this), _entity.meta.getDescribedType()); return factory.bindVariable(var, path); }
/** * Convert this path to a kernel expression. * */ @Override public org.apache.openjpa.kernel.exps.Expression toKernelExpression( ExpressionFactory factory, CriteriaQueryImpl<?> c) { Value path = toValue(factory, c); Value var = factory.newBoundVariable(c.getAlias(this), _entity.meta.getDescribedType()); return factory.bindVariable(var, path); }
public void addToContext(ExpressionFactory factory, MetamodelImpl model, CriteriaQueryImpl<?> q) { String alias = q.getAlias(this); Value var = factory.newBoundVariable(alias, AbstractExpressionBuilder.TYPE_OBJECT); var.setMetaData(_entity.meta); Context currContext = q.ctx(); currContext.addSchema(alias, _entity.meta); currContext.addVariable(alias, var); if (currContext.schemaAlias == null) currContext.schemaAlias = alias; }
protected void evalCrossJoinRoots(QueryExpressions exps, ExpressionFactory factory, CriteriaQueryImpl<?> q) { Set<Root<?>> roots = q.getRoots(); SubqueryImpl<?> subQuery = q.getDelegator(); if (subQuery == null || subQuery.getCorrelatedJoins().isEmpty()) { q.assertRoot(); if (roots.size() > 1) { // cross join for (Root<?> root : roots) { String alias = q.getAlias(root); Value var = factory.newBoundVariable(alias, AbstractExpressionBuilder.TYPE_OBJECT); var.setMetaData(((AbstractManagedType<?>)root.getModel()).meta); q.registerRoot(root, var); } } } }
protected void evalCrossJoinRoots(QueryExpressions exps, ExpressionFactory factory, CriteriaQueryImpl<?> q) { Set<Root<?>> roots = q.getRoots(); SubqueryImpl<?> subQuery = q.getDelegator(); if (subQuery == null || subQuery.getCorrelatedJoins().isEmpty()) { q.assertRoot(); if (roots.size() > 1) { // cross join for (Root<?> root : roots) { String alias = q.getAlias(root); Value var = factory.newBoundVariable(alias, AbstractExpressionBuilder.TYPE_OBJECT); var.setMetaData(((AbstractManagedType<?>)root.getModel()).meta); q.registerRoot(root, var); } } } }
public void addToContext(ExpressionFactory factory, MetamodelImpl model, CriteriaQueryImpl<?> q) { String alias = q.getAlias(this); Value var = factory.newBoundVariable(alias, AbstractExpressionBuilder.TYPE_OBJECT); var.setMetaData(_entity.meta); Context currContext = q.ctx(); currContext.addSchema(alias, _entity.meta); currContext.addVariable(alias, var); if (currContext.schemaAlias == null) currContext.schemaAlias = alias; }
public void addToContext(ExpressionFactory factory, MetamodelImpl model, CriteriaQueryImpl<?> q) { String alias = q.getAlias(this); Value var = factory.newBoundVariable(alias, AbstractExpressionBuilder.TYPE_OBJECT); var.setMetaData(_entity.meta); Context currContext = q.ctx(); currContext.addSchema(alias, _entity.meta); currContext.addVariable(alias, var); if (currContext.schemaAlias == null) currContext.schemaAlias = alias; }
public void addToContext(ExpressionFactory factory, MetamodelImpl model, CriteriaQueryImpl<?> q) { String alias = q.getAlias(this); Value var = factory.newBoundVariable(alias, AbstractExpressionBuilder.TYPE_OBJECT); var.setMetaData(_entity.meta); Context currContext = q.ctx(); currContext.addSchema(alias, _entity.meta); currContext.addVariable(alias, var); if (currContext.schemaAlias == null) currContext.schemaAlias = alias; }
protected void evalCrossJoinRoots(QueryExpressions exps, ExpressionFactory factory, CriteriaQueryImpl<?> q) { Set<Root<?>> roots = q.getRoots(); SubqueryImpl<?> subQuery = q.getDelegator(); if (subQuery == null || subQuery.getCorrelatedJoins().isEmpty()) { q.assertRoot(); if (roots.size() > 1) { // cross join for (Root<?> root : roots) { String alias = q.getAlias(root); Value var = factory.newBoundVariable(alias, AbstractExpressionBuilder.TYPE_OBJECT); var.setMetaData(((AbstractManagedType<?>)root.getModel()).meta); q.registerRoot(root, var); } } } }
protected void evalCrossJoinRoots(QueryExpressions exps, ExpressionFactory factory, CriteriaQueryImpl<?> q) { Set<Root<?>> roots = q.getRoots(); SubqueryImpl<?> subQuery = q.getDelegator(); if (subQuery == null || subQuery.getCorrelatedJoins().isEmpty()) { q.assertRoot(); if (roots.size() > 1) { // cross join for (Root<?> root : roots) { String alias = q.getAlias(root); Value var = factory.newBoundVariable(alias, AbstractExpressionBuilder.TYPE_OBJECT); var.setMetaData(((AbstractManagedType<?>)root.getModel()).meta); q.registerRoot(root, var); } } } }
protected Value createVariable(String id, boolean bind) { // create and cache var Class<?> type = getDeclaredVariableType(id); // add this type to the set of classes in the filter's access path ClassMetaData meta = null; if (type == null) type = TYPE_OBJECT; else meta = getMetaData(type, false); if (meta != null) { addAccessPath(meta); addSchemaToContext(id, meta); } Value var = null; if (bind) var = factory.newBoundVariable(id, type); else var = factory.newUnboundVariable(id, type); var.setMetaData(meta); if (_seenVars == null) _seenVars = new HashMap<String,Value>(); _seenVars.put(id, var); addVariableToContext(id, var); return var; }
protected Value createVariable(String id, boolean bind) { // create and cache var Class<?> type = getDeclaredVariableType(id); // add this type to the set of classes in the filter's access path ClassMetaData meta = null; if (type == null) type = TYPE_OBJECT; else meta = getMetaData(type, false); if (meta != null) { addAccessPath(meta); addSchemaToContext(id, meta); } Value var = null; if (bind) var = factory.newBoundVariable(id, type); else var = factory.newUnboundVariable(id, type); var.setMetaData(meta); if (_seenVars == null) _seenVars = new HashMap<String,Value>(); _seenVars.put(id, var); addVariableToContext(id, var); return var; }
protected Value createVariable(String id, boolean bind) { // create and cache var Class<?> type = getDeclaredVariableType(id); // add this type to the set of classes in the filter's access path ClassMetaData meta = null; if (type == null) type = TYPE_OBJECT; else meta = getMetaData(type, false); if (meta != null) { addAccessPath(meta); addSchemaToContext(id, meta); } Value var = null; if (bind) var = factory.newBoundVariable(id, type); else var = factory.newUnboundVariable(id, type); var.setMetaData(meta); if (_seenVars == null) _seenVars = new HashMap<String,Value>(); _seenVars.put(id, var); addVariableToContext(id, var); return var; }
protected Value createVariable(String id, boolean bind) { // create and cache var Class<?> type = getDeclaredVariableType(id); // add this type to the set of classes in the filter's access path ClassMetaData meta = null; if (type == null) type = TYPE_OBJECT; else meta = getMetaData(type, false); if (meta != null) { addAccessPath(meta); addSchemaToContext(id, meta); } Value var = null; if (bind) var = factory.newBoundVariable(id, type); else var = factory.newUnboundVariable(id, type); var.setMetaData(meta); if (_seenVars == null) _seenVars = new HashMap<String,Value>(); _seenVars.put(id, var); addVariableToContext(id, var); return var; }
Value var = null; if (bind) { var = factory.newBoundVariable(c.getAlias(this),type); join = factory.bindVariable(var, path); c.registerVariable(this, var, path);
Value var = null; if (bind) { var = factory.newBoundVariable(c.getAlias(this),type); join = factory.bindVariable(var, path); c.registerVariable(this, var, path);
Value var = factory.newBoundVariable(c.getAlias(this), type); join = factory.bindVariable(var, path); c.registerVariable(this, var, path); path.setMetaData(meta); Class<?> type = meta == null ? AbstractExpressionBuilder.TYPE_OBJECT : meta.getDescribedType(); Value var = factory.newBoundVariable(c.getAlias(this), type); join = factory.bindVariable(var, parentPath);