[OLINGO-826] Add Containment EntitySet

This commit is contained in:
Christian Amend 2015-11-17 10:36:57 +01:00
parent 3fa2b3df2f
commit a11cb6d659
5 changed files with 93 additions and 27 deletions

View File

@ -155,10 +155,11 @@ public class ComplexTypeProvider {
.setName("CTNavCont") .setName("CTNavCont")
.setProperties(new ArrayList<CsdlProperty>()) .setProperties(new ArrayList<CsdlProperty>())
.setNavigationProperties(Arrays.asList( .setNavigationProperties(Arrays.asList(
PropertyProvider.collectionNavPropertyETKeyNavContMany_CT_ETKeyNav, PropertyProvider.navPropertyETKeyNavOne_CT_ETeyNav,
PropertyProvider.navPropertyETKeyNavContOne_CT_ETeyNav, PropertyProvider.collectionNavPropertyETKeyNavMany_CT_ETKeyNav,
PropertyProvider.collectionNavPropertyETTwoKeyNavContMany_CT_ETKeyNav, PropertyProvider.navPropertyETTwoKeyNavOne_CT_ETTwoKeyNav,
PropertyProvider.navPropertyETTwoKeyNavContOne_CT_ETKeyNav)); PropertyProvider.collectionNavPropertyETTwoKeyNavMany_CT_ETTwoKeyNav
));
} else if (complexTypeName.equals(nameCTBasePrimCompNav)) { } else if (complexTypeName.equals(nameCTBasePrimCompNav)) {
return new CsdlComplexType() return new CsdlComplexType()

View File

@ -99,6 +99,7 @@ public class ContainerProvider {
entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESMixEnumDefCollComp")); entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESMixEnumDefCollComp"));
entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoBaseTwoKeyNav")); entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoBaseTwoKeyNav"));
entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESKeyNavCont")); entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESKeyNavCont"));
entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoKeyNavCont"));
// Singletons // Singletons
List<CsdlSingleton> singletons = new ArrayList<CsdlSingleton>(); List<CsdlSingleton> singletons = new ArrayList<CsdlSingleton>();
@ -524,24 +525,48 @@ public class ContainerProvider {
.setType(EntityTypeProvider.nameETKeyNavCont) .setType(EntityTypeProvider.nameETKeyNavCont)
.setNavigationPropertyBindings(Arrays.asList( .setNavigationPropertyBindings(Arrays.asList(
new CsdlNavigationPropertyBinding() new CsdlNavigationPropertyBinding()
.setPath("NavPropertyETTwoKeyNavContOne/NavPropertyETKeyNavOne") .setPath("NavPropertyETTwoKeyNavOne/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"), .setTarget("ESKeyNav"),
new CsdlNavigationPropertyBinding() new CsdlNavigationPropertyBinding()
.setPath("NavPropertyETTwoKeyNavContMany/NavPropertyETKeyNavOne") .setPath("NavPropertyETTwoKeyNavMany/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"), .setTarget("ESKeyNav"),
new CsdlNavigationPropertyBinding() new CsdlNavigationPropertyBinding()
.setPath("PropertyCompNavCont/NavPropertyETKeyNavContMany/NavPropertyETKeyNavOne") .setPath("NavPropertyETTwoKeyNavContOne")
.setTarget("ESTwoKeyNavCont"),
new CsdlNavigationPropertyBinding()
.setPath("NavPropertyETTwoKeyNavContMany")
.setTarget("ESTwoKeyNavCont"),
new CsdlNavigationPropertyBinding()
.setPath("PropertyCompNavCont/NavPropertyETKeyNavOne/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"), .setTarget("ESKeyNav"),
new CsdlNavigationPropertyBinding() new CsdlNavigationPropertyBinding()
.setPath("PropertyCompNavCont/NavPropertyETKeyNavContOne/NavPropertyETKeyNavOne") .setPath("PropertyCompNavCont/NavPropertyETKeyNavMany/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"), .setTarget("ESKeyNav"),
new CsdlNavigationPropertyBinding() new CsdlNavigationPropertyBinding()
.setPath("PropertyCompNavCont/NavPropertyETTwoKeyNavContMany/NavPropertyETKeyNavOne") .setPath("PropertyCompNavCont/NavPropertyETTwoKeyNavOne/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"), .setTarget("ESKeyNav"),
new CsdlNavigationPropertyBinding() new CsdlNavigationPropertyBinding()
.setPath("PropertyCompNavCont/NavPropertyETTwoKeyNavContOne/NavPropertyETKeyNavOne") .setPath("PropertyCompNavCont/NavPropertyETTwoKeyNavMany/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"))); .setTarget("ESKeyNav")));
} else if (name.equals("ESTwoKeyNavCont")) {
return new CsdlEntitySet()
.setName("ESTwoKeyNavCont")
.setType(EntityTypeProvider.nameETTwoKeyNavCont)
.setNavigationPropertyBindings(Arrays.asList(
new CsdlNavigationPropertyBinding()
.setPath("NavPropertyETKeyNavContOne/NavPropertyETTwoKeyNavContOne")
.setTarget("ESTwoKeyNavCont"),
new CsdlNavigationPropertyBinding()
.setPath("NavPropertyETKeyNavContMany/NavPropertyETTwoKeyNavContOne")
.setTarget("ESTwoKeyNavCont"),
new CsdlNavigationPropertyBinding()
.setPath("NavPropertyETKeyNavContOne/NavPropertyETTwoKeyNavOne/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"),
new CsdlNavigationPropertyBinding()
.setPath("NavPropertyETKeyNavContMany/NavPropertyETTwoKeyNavMany/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav")));
} else if (name.equals("ESBaseTwoKeyNav")) { } else if (name.equals("ESBaseTwoKeyNav")) {
return new CsdlEntitySet() return new CsdlEntitySet()
.setName("ESBaseTwoKeyNav") .setName("ESBaseTwoKeyNav")

View File

@ -57,6 +57,8 @@ public class EntityTypeProvider {
"ETKeyPrimNav"); "ETKeyPrimNav");
public static final FullQualifiedName nameETKeyNavCont = new FullQualifiedName(SchemaProvider.NAMESPACE, public static final FullQualifiedName nameETKeyNavCont = new FullQualifiedName(SchemaProvider.NAMESPACE,
"ETKeyNavCont"); "ETKeyNavCont");
public static final FullQualifiedName nameETTwoKeyNavCont = new FullQualifiedName(SchemaProvider.NAMESPACE,
"ETTwoKeyNavCont");
public static final FullQualifiedName nameETKeyTwoKeyComp = new FullQualifiedName(SchemaProvider.NAMESPACE, public static final FullQualifiedName nameETKeyTwoKeyComp = new FullQualifiedName(SchemaProvider.NAMESPACE,
"ETKeyTwoKeyComp"); "ETKeyTwoKeyComp");
public static final FullQualifiedName nameETMedia = new FullQualifiedName(SchemaProvider.NAMESPACE, "ETMedia"); public static final FullQualifiedName nameETMedia = new FullQualifiedName(SchemaProvider.NAMESPACE, "ETMedia");
@ -339,11 +341,25 @@ public class EntityTypeProvider {
PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable, PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable,
PropertyProvider.propertyCompNavCont)) PropertyProvider.propertyCompNavCont))
.setNavigationProperties(Arrays.asList( .setNavigationProperties(Arrays.asList(
PropertyProvider.navPropertyETTwoKeyNavContOneCT_ETTwoKeyNav, PropertyProvider.navPropertyETTwoKeyNavOneCT_ETTwoKeyNav,
PropertyProvider.collectionNavPropertyETTwoKeyNavContMany_CT_ETTwoKeyNav PropertyProvider.collectionNavPropertyETTwoKeyNavMany_CT_ETTwoKeyNav,
PropertyProvider.navPropertyETTwoKeyNavContOne_ETTwoKeyNav,
PropertyProvider.collectionNavPropertyETTwoKeyNavContMany_ETTwoKeyNav
)); ));
} else if (entityTypeName.equals(nameETTwoKeyNav)) { } else if (entityTypeName.equals(nameETTwoKeyNavCont)) {
return new CsdlEntityType()
.setName("ETTwoKeyNavCont")
.setKey(Arrays.asList(
new CsdlPropertyRef().setName("PropertyInt16"),
new CsdlPropertyRef().setName("PropertyString")))
.setProperties(Arrays.asList(
PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable))
.setNavigationProperties(Arrays.asList(
PropertyProvider.navPropertyETTwoKeyNavContOneCT_ETTwoKeyNav,
PropertyProvider.collectionNavPropertyETTwoKeyNavContMany_CT_ETTwoKeyNav
));
} else if (entityTypeName.equals(nameETTwoKeyNav)) {
return new CsdlEntityType() return new CsdlEntityType()
.setName("ETTwoKeyNav") .setName("ETTwoKeyNav")
.setKey(Arrays.asList( .setKey(Arrays.asList(

View File

@ -692,19 +692,19 @@ public class PropertyProvider {
.setCollection(false) .setCollection(false)
.setType(EntityTypeProvider.nameETTwoKeyNav); .setType(EntityTypeProvider.nameETTwoKeyNav);
public static final CsdlNavigationProperty collectionNavPropertyETKeyNavContMany_CT_ETKeyNav = public static final CsdlNavigationProperty collectionNavPropertyETKeyNavMany_CT_ETKeyNav =
new CsdlNavigationProperty() new CsdlNavigationProperty()
.setName("NavPropertyETKeyNavContMany") .setName("NavPropertyETKeyNavMany")
.setCollection(true) .setCollection(true)
.setContainsTarget(true) .setContainsTarget(true)
.setType(EntityTypeProvider.nameETKeyNav); .setType(EntityTypeProvider.nameETKeyNav);
public static final CsdlNavigationProperty collectionNavPropertyETTwoKeyNavContMany_CT_ETKeyNav = // public static final CsdlNavigationProperty collectionNavPropertyETTwoKeyNavContMany_CT_ETKeyNav =
new CsdlNavigationProperty() // new CsdlNavigationProperty()
.setName("NavPropertyETTwoKeyNavContMany") // .setName("NavPropertyETTwoKeyNavContMany")
.setCollection(true) // .setCollection(true)
.setContainsTarget(true) // .setContainsTarget(true)
.setType(EntityTypeProvider.nameETKeyNav); // .setType(EntityTypeProvider.nameETKeyNav);
public static final CsdlNavigationProperty navPropertyETKeyNavOne_ETKeyNav = new CsdlNavigationProperty() public static final CsdlNavigationProperty navPropertyETKeyNavOne_ETKeyNav = new CsdlNavigationProperty()
.setName("NavPropertyETKeyNavOne") .setName("NavPropertyETKeyNavOne")
@ -737,24 +737,47 @@ public class PropertyProvider {
.setName("NavPropertyETAllPrimOne") .setName("NavPropertyETAllPrimOne")
.setType(EntityTypeProvider.nameETAllPrim); .setType(EntityTypeProvider.nameETAllPrim);
public static final CsdlNavigationProperty navPropertyETKeyNavContOne_CT_ETeyNav = new CsdlNavigationProperty() public static final CsdlNavigationProperty navPropertyETKeyNavOne_CT_ETeyNav = new CsdlNavigationProperty()
.setName("NavPropertyETKeyNavContOne") .setName("NavPropertyETKeyNavOne")
.setContainsTarget(true) .setContainsTarget(true)
.setType(EntityTypeProvider.nameETKeyNav); .setType(EntityTypeProvider.nameETKeyNav);
public static final CsdlNavigationProperty navPropertyETTwoKeyNavContOne_CT_ETKeyNav = new CsdlNavigationProperty() public static final CsdlNavigationProperty navPropertyETTwoKeyNavOne_CT_ETTwoKeyNav = new CsdlNavigationProperty()
.setName("NavPropertyETTwoKeyNavContOne") .setName("NavPropertyETTwoKeyNavOne")
.setContainsTarget(true) .setContainsTarget(true)
.setType(EntityTypeProvider.nameETKeyNav); .setType(EntityTypeProvider.nameETTwoKeyNav);
public static final CsdlNavigationProperty navPropertyETTwoKeyNavContOne_ETTwoKeyNav = new CsdlNavigationProperty()
.setName("NavPropertyETTwoKeyNavContOne")
.setType(EntityTypeProvider.nameETTwoKeyNav);
public static final CsdlNavigationProperty navPropertyETTwoKeyNavContOneCT_ETTwoKeyNav = new CsdlNavigationProperty() public static final CsdlNavigationProperty navPropertyETTwoKeyNavContOneCT_ETTwoKeyNav = new CsdlNavigationProperty()
.setName("NavPropertyETTwoKeyNavContOne") .setName("NavPropertyETTwoKeyNavContOne")
.setContainsTarget(true) .setContainsTarget(true)
.setType(EntityTypeProvider.nameETTwoKeyNav); .setType(EntityTypeProvider.nameETTwoKeyNav);
public static final CsdlNavigationProperty collectionNavPropertyETTwoKeyNavContMany_ETTwoKeyNav =
new CsdlNavigationProperty()
.setName("NavPropertyETTwoKeyNavContMany")
.setContainsTarget(false)
.setCollection(true)
.setType(EntityTypeProvider.nameETTwoKeyNav);
public static final CsdlNavigationProperty collectionNavPropertyETTwoKeyNavContMany_CT_ETTwoKeyNav = public static final CsdlNavigationProperty collectionNavPropertyETTwoKeyNavContMany_CT_ETTwoKeyNav =
new CsdlNavigationProperty() new CsdlNavigationProperty()
.setName("NavPropertyETTwoKeyNavContMany") .setName("NavPropertyETTwoKeyNavContMany")
.setContainsTarget(false)
.setCollection(true)
.setType(EntityTypeProvider.nameETTwoKeyNav);
public static final CsdlNavigationProperty navPropertyETTwoKeyNavOneCT_ETTwoKeyNav = new CsdlNavigationProperty()
.setName("NavPropertyETTwoKeyNavOne")
.setContainsTarget(true)
.setType(EntityTypeProvider.nameETTwoKeyNav);
public static final CsdlNavigationProperty collectionNavPropertyETTwoKeyNavMany_CT_ETTwoKeyNav =
new CsdlNavigationProperty()
.setName("NavPropertyETTwoKeyNavMany")
.setContainsTarget(true) .setContainsTarget(true)
.setCollection(true) .setCollection(true)
.setType(EntityTypeProvider.nameETTwoKeyNav); .setType(EntityTypeProvider.nameETTwoKeyNav);

View File

@ -79,6 +79,7 @@ public class SchemaProvider {
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav)); entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETBaseTwoKeyNav));
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoBaseTwoKeyNav)); entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoBaseTwoKeyNav));
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETKeyNavCont)); entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETKeyNavCont));
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETTwoKeyNavCont));
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompMixPrimCollComp)); entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETCompMixPrimCollComp));
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETKeyPrimNav)); entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETKeyPrimNav));
entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAbstract)); entityTypes.add(prov.getEntityType(EntityTypeProvider.nameETAbstract));