static CsdlComplexType complexType(String name) {
    ArrayList<CsdlProperty> properties = new ArrayList<CsdlProperty>();
    properties.add(createProperty("street", EdmPrimitiveTypeKind.String));
    properties.add(createProperty("city", EdmPrimitiveTypeKind.String));
    properties.add(createProperty("state", EdmPrimitiveTypeKind.String));

    CsdlComplexType type = new CsdlComplexType();
    type.setName(name).setProperties(properties);

    return type;
  }
  static CsdlEntityType buildPersonEntity(CsdlComplexType address) {
    ArrayList<CsdlProperty> properties = new ArrayList<CsdlProperty>();
    properties.add(createProperty("name", EdmPrimitiveTypeKind.String).setMaxLength(25));
    properties.add(createProperty("ssn", EdmPrimitiveTypeKind.Int64).setNullable(false));
    properties.add(new CsdlProperty().setName("address").setType(address.getName()));
    properties.add(new CsdlProperty().setName("secondaddress").setType(address.getName()));

    CsdlEntityType entityType = new CsdlEntityType();
    entityType.setName("Person");
    entityType.setProperties(properties);
    entityType.setKey(Arrays.asList(new CsdlPropertyRef().setName("ssn")));
    return entityType;
  }
  private CsdlEntityType buildBusinessEntity(CsdlComplexType address) {
    ArrayList<CsdlProperty> properties = new ArrayList<CsdlProperty>();
    properties.add(createProperty("name", EdmPrimitiveTypeKind.String).setMaxLength(25));
    properties.add(new CsdlProperty().setName("address").setType(address.getName()));

    CsdlEntityType entityType = new CsdlEntityType();
    entityType.setName("Business");
    entityType.setProperties(properties);
    entityType.setKey(Arrays.asList(new CsdlPropertyRef().setName("name")));
    return entityType;
  }