public static ParsedRestriction parseRestriction(Restriction<?> r){
		ParsedRestriction result = new ParsedRestriction();
		StringBuffer sb = new StringBuffer();
		List<Expression> expressions = Util.getExpressions(r);
		List<Order> order = new ArrayList<Order>();
		Limit limit = null;
		for(Expression expression : expressions){
			if(expression instanceof Order){
				order.add((Order)expression);
			}else if(expression instanceof Limit){
				limit = (Limit)expression;
			}else{
				if(sb.length()!=0)
					sb.append(" AND ");
				else
					sb.append(" WHERE ");
				parseExpression(expression, sb, result); // 解析Expression
			}
		}
		// Order处理
		for(int i=0, size=order.size(); i<size; i++){
			if(i==0)
				sb.append(" ORDER BY ");
			else
				sb.append(',');
			Order temp = order.get(i);
			sb.append('`'+temp.getProp().getColumn()+'`');
			if(temp.isAsc())
				sb.append(" ASC");
			else
				sb.append(" DESC");
		}
		// Limit处理
		if(limit!=null){
			sb.append(" limit ?, ?");
			result.addColumn(null, limit.getFrom());
			result.addColumn(null, limit.getPageSize());
		}
		result.setSql(sb.toString());
		
		return result;
	}