public String generate(List<String> joinTables, List<String> joinTableIds)
	{
		StringBuilder sb = new StringBuilder();
		List<String> added = new ArrayList<String>();

		for (int x = 0; x < joinTables.size(); x++)
		{
			if (!added.contains(joinTableIds.get(x)))
			{
				added.add(joinTableIds.get(x));
				if (sb.length() > 0)
				{
					sb.append(" ");
					sb.append(adapter.getJoinKeyword());
					sb.append(" ");
				}
				JoinDescriptor jd = getJoinDescriptorForTable(joinTables.get(x), joinTableIds.get(x));
				if (jd != null)
				{
					sb.append(jd.toString());
				}
				else
				{
					sb.append(joinTables.get(x));
					sb.append(" AS ");
					sb.append(joinTableIds.get(x));
				}
			}
		}
		return sb.toString();
	}