/** * Creates a copy of this expression node, without copying children. */ @Override public Expression shallowCopy() { return new ASTEqual(id); }
/** * Creates a copy of this expression node, without copying children. */ public Expression shallowCopy() { return new ASTEqual(id); }
/** * @since 4.0 * @see ExpressionFactory#matchExp(String, Object) */ static Expression matchExp(Expression exp, Object value) { if(!(exp instanceof SimpleNode)) { throw new IllegalArgumentException("exp should be instance of SimpleNode"); } return new ASTEqual((SimpleNode)exp, value); }
private Expression match(ASTPath path, Map<String, Object> idMap) { Object value = idMap.get(path.getPath()); if (value == null) { throw new AgException(Status.BAD_REQUEST, "No ID value for path: " + path); } return new ASTEqual(path, value); }
/** * A convenience method to create an DB_PATH "equal to" expression. */ public static Expression matchDbExp(String pathSpec, Object value) { return new ASTEqual(new ASTDbPath(pathSpec), value); }
/** * A convenience method to create an DB_PATH "equal to" expression. */ public static Expression matchDbExp(String pathSpec, Object value) { return new ASTEqual(new ASTDbPath(pathSpec), value); }
/** * A convenience method to create an OBJ_PATH "equal to" expression. */ public static Expression matchExp(String pathSpec, Object value) { return new ASTEqual(new ASTObjPath(pathSpec), value); }
@SuppressWarnings("unchecked") public static <A> A findById(ObjectContext context, Class<A> type, AgEntity<?> agEntity, Object id) { ObjEntity entity = context.getEntityResolver().getObjEntity(type); // sanity checking... if (entity == null) { throw new AgException(Status.INTERNAL_SERVER_ERROR, "Unknown entity class: " + type); } if (id == null) { throw new AgException(Status.BAD_REQUEST, "No id specified"); } if (id instanceof Map) { Map<String, Object> ids = (Map<String, Object>) id; ObjectSelect<A> query = ObjectSelect.query(type); for (Map.Entry<String, Object> entry : ids.entrySet()) { query.and(ExpressionFactory.matchDbExp( entity.getDbEntity().getAttribute(entry.getKey()).getName(), entry.getValue() )); } return query.selectOne(context); } else { AgAttribute attribute = agEntity.getIds().iterator().next(); return ObjectSelect.query(type, new ASTEqual(attribute.getPathExp(), id)).selectOne(context); } } }
throw new ParseException(); ASTEqual jjtn001 = new ASTEqual(JJTEQUAL); boolean jjtc001 = true; jjtree.openNodeScope(jjtn001);
throw new ParseException(); ASTEqual jjtn003 = new ASTEqual(JJTEQUAL); boolean jjtc003 = true; jjtree.openNodeScope(jjtn003);