@Override org.apache.openjpa.kernel.exps.Value toValue(ExpressionFactory factory, CriteriaQueryImpl<?> q) { if (_exps.isEmpty()) { return factory.newLiteral(_op == BooleanOperator.AND, Literal.TYPE_BOOLEAN); } throw new AbstractMethodError(this.getClass().getName()); }
private Value getIntegerValue(JPQLNode node) { BigDecimal bigdec = new BigDecimal (node.text.endsWith("l") || node.text.endsWith("L") ? node.text.substring(0, node.text.length() - 1) : node.text). multiply(new BigDecimal(negative(node))); return factory.newLiteral(Integer.valueOf(bigdec.intValue()), Literal.TYPE_NUMBER); }
@Override org.apache.openjpa.kernel.exps.Value toValue(ExpressionFactory factory, CriteriaQueryImpl<?> q) { if (_exps.isEmpty()) { return factory.newLiteral(_op == BooleanOperator.AND, Literal.TYPE_BOOLEAN); } throw new AbstractMethodError(this.getClass().getName()); }
private Value getIntegerValue(JPQLNode node) { BigDecimal bigdec = new BigDecimal (node.text.endsWith("l") || node.text.endsWith("L") ? node.text.substring(0, node.text.length() - 1) : node.text). multiply(new BigDecimal(negative(node))); return factory.newLiteral(Integer.valueOf(bigdec.intValue()), Literal.TYPE_NUMBER); }
@Override org.apache.openjpa.kernel.exps.Value toValue(ExpressionFactory factory, CriteriaQueryImpl<?> q) { if (_exps.isEmpty()) { return factory.newLiteral(_op == BooleanOperator.AND, Literal.TYPE_BOOLEAN); } throw new AbstractMethodError(this.getClass().getName()); }
private Value getIntegerValue(JPQLNode node) { BigDecimal bigdec = new BigDecimal (node.text.endsWith("l") || node.text.endsWith("L") ? node.text.substring(0, node.text.length() - 1) : node.text). multiply(new BigDecimal(negative(node))); return factory.newLiteral(Integer.valueOf(bigdec.intValue()), Literal.TYPE_NUMBER); }
@Override org.apache.openjpa.kernel.exps.Value toValue(ExpressionFactory factory, CriteriaQueryImpl<?> q) { if (_exps.isEmpty()) { return factory.newLiteral(_op == BooleanOperator.AND, Literal.TYPE_BOOLEAN); } throw new AbstractMethodError(this.getClass().getName()); }
private Value getIntegerValue(JPQLNode node) { BigDecimal bigdec = new BigDecimal (node.text.endsWith("l") || node.text.endsWith("L") ? node.text.substring(0, node.text.length() - 1) : node.text). multiply(new BigDecimal(negative(node))); return factory.newLiteral(Integer.valueOf(bigdec.intValue()), Literal.TYPE_NUMBER); }
@Override public Value toValue(ExpressionFactory factory, CriteriaQueryImpl<?> q) { Value val = Expressions.toValue(e, factory, q); Value result; if (val instanceof Literal && ((Literal)val).getParseType() == Literal.TYPE_COLLECTION) result = factory.newLiteral(((Collection)((Literal)val).getValue()).size(), Literal.TYPE_NUMBER); else result = factory.size(val); result.setImplicitType(Integer.class); return result; }
@Override public Value toValue(ExpressionFactory factory, CriteriaQueryImpl<?> q) { Value val = Expressions.toValue(e, factory, q); Value result; if (val instanceof Literal && ((Literal)val).getParseType() == Literal.TYPE_COLLECTION) result = factory.newLiteral(((Collection)((Literal)val).getValue()).size(), Literal.TYPE_NUMBER); else result = factory.size(val); result.setImplicitType(Integer.class); return result; }
@Override public Value toValue(ExpressionFactory factory, CriteriaQueryImpl<?> q) { Value val = Expressions.toValue(e, factory, q); Value result; if (val instanceof Literal && ((Literal)val).getParseType() == Literal.TYPE_COLLECTION) result = factory.newLiteral(((Collection)((Literal)val).getValue()).size(), Literal.TYPE_NUMBER); else result = factory.size(val); result.setImplicitType(Integer.class); return result; }
@Override public Value toValue(ExpressionFactory factory, CriteriaQueryImpl<?> q) { Value val = Expressions.toValue(e, factory, q); Value result; if (val instanceof Literal && ((Literal)val).getParseType() == Literal.TYPE_COLLECTION) result = factory.newLiteral(((Collection)((Literal)val).getValue()).size(), Literal.TYPE_NUMBER); else result = factory.size(val); result.setImplicitType(Integer.class); return result; }
private Value getPathOrConstant(JPQLNode node) { // first check to see if the path is an enum or static field, and // if so, load it String className = assemble(node, ".", 1); Class<?> c = resolver.classForName(className, null); if (c != null) { String fieldName = lastChild(node).text; int type = (c.isEnum() ? Literal.TYPE_ENUM : Literal.TYPE_UNKNOWN); try { Field field = c.getField(fieldName); Object value = field.get(null); return factory.newLiteral(value, type); } catch (NoSuchFieldException nsfe) { if (node.inEnumPath) throw parseException(EX_USER, "no-field", new Object[]{ c.getName(), fieldName }, nsfe); else return getPath(node, false, true); } catch (Exception e) { throw parseException(EX_USER, "unaccessible-field", new Object[]{ className, fieldName }, e); } } else { return getPath(node, false, true); } }
private Value getPathOrConstant(JPQLNode node) { // first check to see if the path is an enum or static field, and // if so, load it String className = assemble(node, ".", 1); Class<?> c = resolver.classForName(className, null); if (c != null) { String fieldName = lastChild(node).text; int type = (c.isEnum() ? Literal.TYPE_ENUM : Literal.TYPE_UNKNOWN); try { Field field = c.getField(fieldName); Object value = field.get(null); return factory.newLiteral(value, type); } catch (NoSuchFieldException nsfe) { if (node.inEnumPath) throw parseException(EX_USER, "no-field", new Object[]{ c.getName(), fieldName }, nsfe); else return getPath(node, false, true); } catch (Exception e) { throw parseException(EX_USER, "unaccessible-field", new Object[]{ className, fieldName }, e); } } else { return getPath(node, false, true); } }
private Value getPathOrConstant(JPQLNode node) { // first check to see if the path is an enum or static field, and // if so, load it String className = assemble(node, ".", 1); Class<?> c = resolver.classForName(className, null); if (c != null) { String fieldName = lastChild(node).text; int type = (c.isEnum() ? Literal.TYPE_ENUM : Literal.TYPE_UNKNOWN); try { Field field = c.getField(fieldName); Object value = field.get(null); return factory.newLiteral(value, type); } catch (NoSuchFieldException nsfe) { if (node.inEnumPath) throw parseException(EX_USER, "no-field", new Object[]{ c.getName(), fieldName }, nsfe); else return getPath(node, false, true); } catch (Exception e) { throw parseException(EX_USER, "unaccessible-field", new Object[]{ className, fieldName }, e); } } else { return getPath(node, false, true); } }
literalType = Literal.TYPE_COLLECTION; return factory.newLiteral(value, literalType);
literalType = Literal.TYPE_COLLECTION; return factory.newLiteral(value, literalType);
literalType = Literal.TYPE_COLLECTION; return factory.newLiteral(value, literalType);
literalType = Literal.TYPE_COLLECTION; return factory.newLiteral(value, literalType);
private Value getPathOrConstant(JPQLNode node) { // first check to see if the path is an enum or static field, and // if so, load it String className = assemble(node, ".", 1); Class c = resolver.classForName(className, null); if (c != null) { String fieldName = lastChild(node).text; try { Field field = c.getField(fieldName); Object value = field.get(null); return factory.newLiteral(value, Literal.TYPE_UNKNOWN); } catch (NoSuchFieldException nsfe) { if (node.inEnumPath) throw parseException(EX_USER, "no-field", new Object[]{ c.getName(), fieldName }, nsfe); else return getPath(node, false, true); } catch (Exception e) { throw parseException(EX_USER, "unaccessible-field", new Object[]{ className, fieldName }, e); } } else { return getPath(node, false, true); } }