private Expression addJoin(Path path, JPQLNode aliasNode, Expression exp) { FieldMetaData fmd = path.last(); if (fmd == null) throw parseException(EX_USER, "path-no-meta", new Object[]{ path, null }, null); String alias = aliasNode != null ? aliasNode.text : nextAlias(); Value var = getVariable(alias, true); var.setMetaData(getFieldType(fmd)); Expression join = null; // if the variable is already bound, get the var's value and // do a regular contains with that boolean bound = isBound(var); if (bound) { var = getValue(aliasNode, VAR_PATH); } else { bind(var); join = and(join, factory.bindVariable(var, path)); } if (!fmd.isTypePC()) // multi-valued relation { if (bound) join = and(join, factory.contains(path, var)); setImplicitContainsTypes(path, var, CONTAINS_TYPE_ELEMENT); } return and(exp, join); }
private Expression addJoin(Path path, JPQLNode aliasNode, Expression exp) { FieldMetaData fmd = path.last(); if (fmd == null) throw parseException(EX_USER, "path-no-meta", new Object[]{ path, null }, null); String alias = aliasNode != null ? aliasNode.text : nextAlias(); Value var = getVariable(alias, true); var.setMetaData(getFieldType(fmd)); Expression join = null; // if the variable is already bound, get the var's value and // do a regular contains with that boolean bound = isBound(var); if (bound) { var = getValue(aliasNode, VAR_PATH); } else { bind(var); join = and(join, factory.bindVariable(var, path)); } if (!fmd.isTypePC()) // multi-valued relation { if (bound) join = and(join, factory.contains(path, var)); setImplicitContainsTypes(path, var, CONTAINS_TYPE_ELEMENT); } return and(exp, join); }
private Expression addJoin(Path path, JPQLNode aliasNode, Expression exp) { FieldMetaData fmd = path.last(); if (fmd == null) throw parseException(EX_USER, "path-no-meta", new Object[]{ path, null }, null); String alias = aliasNode != null ? aliasNode.text : nextAlias(); Value var = getVariable(alias, true); var.setMetaData(getFieldType(fmd)); Expression join = null; // if the variable is already bound, get the var's value and // do a regular contains with that boolean bound = isBound(var); if (bound) { var = getValue(aliasNode, VAR_PATH); } else { bind(var); join = and(join, factory.bindVariable(var, path)); } if (!fmd.isTypePC()) // multi-valued relation { if (bound) join = and(join, factory.contains(path, var)); setImplicitContainsTypes(path, var, CONTAINS_TYPE_ELEMENT); } return and(exp, join); }
private Expression addJoin(Path path, JPQLNode aliasNode, Expression exp) { FieldMetaData fmd = path.last(); if (fmd == null) throw parseException(EX_USER, "path-no-meta", new Object[]{ path, null }, null); String alias = aliasNode != null ? aliasNode.text : nextAlias(); Value var = getVariable(alias, true); var.setMetaData(getFieldType(fmd)); Expression join = null; // if the variable is already bound, get the var's value and // do a regular contains with that boolean bound = isBound(var); if (bound) { var = getValue(aliasNode, VAR_PATH); } else { bind(var); join = and(join, factory.bindVariable(var, path)); } if (!fmd.isTypePC()) // multi-valued relation { if (bound) join = and(join, factory.contains(path, var)); setImplicitContainsTypes(path, var, CONTAINS_TYPE_ELEMENT); } return and(exp, join); }
private Expression addJoin(Path path, JPQLNode aliasNode, Expression exp) { FieldMetaData fmd = path.last(); if (fmd == null) throw parseException(EX_USER, "path-no-meta", new Object[]{ path, null }, null); String alias = aliasNode != null ? aliasNode.text : nextAlias(); Value var = getVariable(alias, true); var.setMetaData(getFieldType(fmd)); Expression join = null; // if the variable is already bound, get the var's value and // do a regular contains with that boolean bound = isBound(var); if (bound) { var = getValue(aliasNode, VAR_PATH); } else { bind(var); join = and(join, factory.bindVariable(var, path)); } if (!fmd.isTypePC()) // multi-valued relation { if (bound) join = and(join, factory.contains(path, var)); setImplicitContainsTypes(path, var, CONTAINS_TYPE_ELEMENT); } return and(exp, join); }