public void addPropertyTablesToJoin(ObjectStack propertyStack)
	{
		boolean propertiesFound = false;
		List<ObjectRepresentation> allReps = propertyStack
				.getAllRepresentations();
		for (ObjectRepresentation rep : allReps)
		{
			if (!propertiesFound)
			{
				if (rep.getNonNullPropertyCount() > 0 || rep.isArray())
				{
					propertiesFound = true;
				}
			}
			if (propertiesFound)
			{
				if (rep.isArray())
				{
					addPropertyTableToJoin(NameGenerator.getArrayTablename(adapter),
							rep.getAsName());
				}
				else
				{
					addPropertyTableToJoin(rep.getTableName(), rep.getAsName());
				}
			}
		}
	}