public IdStatementGenerator(AdapterBase adapter, ObjectStack oStack,
			Clause[] clauses, boolean addJoins)
	{
		this.adapter = adapter;
		this.addJoins = addJoins;
		this.asGenerator = new AsStatementGenerator(this.adapter);
		this.addTablesToJoin(oStack);
		if (addJoins)
		{
			Node linker = oStack.getNode(Object.class);
			if (linker == null)
			{
				linker = oStack.getActual();
			}
			// recursively add join tables
			addLinks(oStack, oStack.getActual(), linker);
		}
	}