class SelectUtils {

	public static Join addJoin(Select select, final Table table, final Expression onExpression) {
		if (select.getSelectBody() instanceof PlainSelect) {
			PlainSelect plainSelect = (PlainSelect) select.getSelectBody();
			List<Join> joins = plainSelect.getJoins();
			if (joins == null) {
				joins = new ArrayList<Join>();
				plainSelect.setJoins(joins);
			}
			Join join = new Join();
			join.setRightItem(table);
			join.setOnExpression(onExpression);
			joins.add(join);
			return join;
		}
		throw new UnsupportedOperationException("Not supported yet.");
	}

	private  SelectUtils();

}