}
//3 TODO: Without schema you will get nulls instead of Exceptions. Add exception/error notification.
Document firstJUG = worldJugs.get(0);
DocumentType jugType = DocumentType.createDocumentType("WorldJUGs", firstJUG);
jugType.setReference("location", ElementType.TYPE_REFERENCE, "Location", "country");
connection.saveDocumentType(jugType);
Document jugLocation = (Document) firstJUG.get("location");
DocumentType locationType = DocumentType.createDocumentType("Location", jugLocation);
locationType.setReference("venue", ElementType.TYPE_BACK_REFERENCE, "WorldJUGs", "NONE");
connection.saveDocumentType(locationType);