[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")
.setProperties(new ArrayList<CsdlProperty>())
.setNavigationProperties(Arrays.asList(
PropertyProvider.collectionNavPropertyETKeyNavContMany_CT_ETKeyNav,
PropertyProvider.navPropertyETKeyNavContOne_CT_ETeyNav,
PropertyProvider.collectionNavPropertyETTwoKeyNavContMany_CT_ETKeyNav,
PropertyProvider.navPropertyETTwoKeyNavContOne_CT_ETKeyNav));
PropertyProvider.navPropertyETKeyNavOne_CT_ETeyNav,
PropertyProvider.collectionNavPropertyETKeyNavMany_CT_ETKeyNav,
PropertyProvider.navPropertyETTwoKeyNavOne_CT_ETTwoKeyNav,
PropertyProvider.collectionNavPropertyETTwoKeyNavMany_CT_ETTwoKeyNav
));
} else if (complexTypeName.equals(nameCTBasePrimCompNav)) {
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, "ESTwoBaseTwoKeyNav"));
entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESKeyNavCont"));
entitySets.add(prov.getEntitySet(ContainerProvider.nameContainer, "ESTwoKeyNavCont"));
// Singletons
List<CsdlSingleton> singletons = new ArrayList<CsdlSingleton>();
@ -524,24 +525,48 @@ public class ContainerProvider {
.setType(EntityTypeProvider.nameETKeyNavCont)
.setNavigationPropertyBindings(Arrays.asList(
new CsdlNavigationPropertyBinding()
.setPath("NavPropertyETTwoKeyNavContOne/NavPropertyETKeyNavOne")
.setPath("NavPropertyETTwoKeyNavOne/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"),
new CsdlNavigationPropertyBinding()
.setPath("NavPropertyETTwoKeyNavContMany/NavPropertyETKeyNavOne")
.setPath("NavPropertyETTwoKeyNavMany/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"),
new CsdlNavigationPropertyBinding()
.setPath("PropertyCompNavCont/NavPropertyETKeyNavContMany/NavPropertyETKeyNavOne")
.setPath("NavPropertyETTwoKeyNavContOne")
.setTarget("ESTwoKeyNavCont"),
new CsdlNavigationPropertyBinding()
.setPath("NavPropertyETTwoKeyNavContMany")
.setTarget("ESTwoKeyNavCont"),
new CsdlNavigationPropertyBinding()
.setPath("PropertyCompNavCont/NavPropertyETKeyNavOne/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"),
new CsdlNavigationPropertyBinding()
.setPath("PropertyCompNavCont/NavPropertyETKeyNavContOne/NavPropertyETKeyNavOne")
.setPath("PropertyCompNavCont/NavPropertyETKeyNavMany/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"),
new CsdlNavigationPropertyBinding()
.setPath("PropertyCompNavCont/NavPropertyETTwoKeyNavContMany/NavPropertyETKeyNavOne")
.setPath("PropertyCompNavCont/NavPropertyETTwoKeyNavOne/NavPropertyETKeyNavOne")
.setTarget("ESKeyNav"),
new CsdlNavigationPropertyBinding()
.setPath("PropertyCompNavCont/NavPropertyETTwoKeyNavContOne/NavPropertyETKeyNavOne")
.setPath("PropertyCompNavCont/NavPropertyETTwoKeyNavMany/NavPropertyETKeyNavOne")
.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")) {
return new CsdlEntitySet()
.setName("ESBaseTwoKeyNav")

View File

@ -57,6 +57,8 @@ public class EntityTypeProvider {
"ETKeyPrimNav");
public static final FullQualifiedName nameETKeyNavCont = new FullQualifiedName(SchemaProvider.NAMESPACE,
"ETKeyNavCont");
public static final FullQualifiedName nameETTwoKeyNavCont = new FullQualifiedName(SchemaProvider.NAMESPACE,
"ETTwoKeyNavCont");
public static final FullQualifiedName nameETKeyTwoKeyComp = new FullQualifiedName(SchemaProvider.NAMESPACE,
"ETKeyTwoKeyComp");
public static final FullQualifiedName nameETMedia = new FullQualifiedName(SchemaProvider.NAMESPACE, "ETMedia");
@ -339,11 +341,25 @@ public class EntityTypeProvider {
PropertyProvider.propertyInt16_NotNullable, PropertyProvider.propertyString_NotNullable,
PropertyProvider.propertyCompNavCont))
.setNavigationProperties(Arrays.asList(
PropertyProvider.navPropertyETTwoKeyNavContOneCT_ETTwoKeyNav,
PropertyProvider.collectionNavPropertyETTwoKeyNavContMany_CT_ETTwoKeyNav
PropertyProvider.navPropertyETTwoKeyNavOneCT_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()
.setName("ETTwoKeyNav")
.setKey(Arrays.asList(

View File

@ -692,19 +692,19 @@ public class PropertyProvider {
.setCollection(false)
.setType(EntityTypeProvider.nameETTwoKeyNav);
public static final CsdlNavigationProperty collectionNavPropertyETKeyNavContMany_CT_ETKeyNav =
public static final CsdlNavigationProperty collectionNavPropertyETKeyNavMany_CT_ETKeyNav =
new CsdlNavigationProperty()
.setName("NavPropertyETKeyNavContMany")
.setName("NavPropertyETKeyNavMany")
.setCollection(true)
.setContainsTarget(true)
.setType(EntityTypeProvider.nameETKeyNav);
public static final CsdlNavigationProperty collectionNavPropertyETTwoKeyNavContMany_CT_ETKeyNav =
new CsdlNavigationProperty()
.setName("NavPropertyETTwoKeyNavContMany")
.setCollection(true)
.setContainsTarget(true)
.setType(EntityTypeProvider.nameETKeyNav);
// public static final CsdlNavigationProperty collectionNavPropertyETTwoKeyNavContMany_CT_ETKeyNav =
// new CsdlNavigationProperty()
// .setName("NavPropertyETTwoKeyNavContMany")
// .setCollection(true)
// .setContainsTarget(true)
// .setType(EntityTypeProvider.nameETKeyNav);
public static final CsdlNavigationProperty navPropertyETKeyNavOne_ETKeyNav = new CsdlNavigationProperty()
.setName("NavPropertyETKeyNavOne")
@ -737,24 +737,47 @@ public class PropertyProvider {
.setName("NavPropertyETAllPrimOne")
.setType(EntityTypeProvider.nameETAllPrim);
public static final CsdlNavigationProperty navPropertyETKeyNavContOne_CT_ETeyNav = new CsdlNavigationProperty()
.setName("NavPropertyETKeyNavContOne")
public static final CsdlNavigationProperty navPropertyETKeyNavOne_CT_ETeyNav = new CsdlNavigationProperty()
.setName("NavPropertyETKeyNavOne")
.setContainsTarget(true)
.setType(EntityTypeProvider.nameETKeyNav);
public static final CsdlNavigationProperty navPropertyETTwoKeyNavContOne_CT_ETKeyNav = new CsdlNavigationProperty()
.setName("NavPropertyETTwoKeyNavContOne")
public static final CsdlNavigationProperty navPropertyETTwoKeyNavOne_CT_ETTwoKeyNav = new CsdlNavigationProperty()
.setName("NavPropertyETTwoKeyNavOne")
.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()
.setName("NavPropertyETTwoKeyNavContOne")
.setContainsTarget(true)
.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 =
new CsdlNavigationProperty()
.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)
.setCollection(true)
.setType(EntityTypeProvider.nameETTwoKeyNav);

View File

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