Examples of EntitySet


Examples of org.apache.olingo.odata2.api.edm.provider.EntitySet

  }

  @Override
  public EntitySet getEntitySet(final String entityContainer, final String name) throws ODataException {

    EntitySet returnedSet = null;
    EntityContainer container = null;
    if (!entityContainerInfos.containsKey(entityContainer)) {
      container = (EntityContainer) getEntityContainerInfo(entityContainer);
    } else {
      container = (EntityContainer) entityContainerInfos.get(entityContainer);
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.EntitySet

    return createMockedEdmEntitySet(edmProvider, entitySetName);
  }

  private EdmEntitySet createMockedEdmEntitySet(final AnnotationEdmProvider edmProvider, final String entitySetName)
      throws ODataException {
    EntitySet entitySet = edmProvider.getEntitySet(DEFAULT_CONTAINER, entitySetName);
    FullQualifiedName entityType = entitySet.getEntityType();

    EdmEntitySet edmEntitySet = Mockito.mock(EdmEntitySet.class);
    Mockito.when(edmEntitySet.getName()).thenReturn(entitySetName);
    EdmEntityType edmEntityType = Mockito.mock(EdmEntityType.class);
    Mockito.when(edmEntitySet.getEntityType()).thenReturn(edmEntityType);
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.EntitySet

  @Test
  public void oneEntitySetOneContainerForInfo() throws Exception {
    String entitySetUriString = new URI("Employees").toASCIIString();

    List<EntitySet> entitySets = new ArrayList<EntitySet>();
    EntitySet entitySet = new EntitySet().setName("Employees");
    entitySets.add(entitySet);

    List<EntityContainer> entityContainers = new ArrayList<EntityContainer>();
    EntityContainer container =
        new EntityContainer().setDefaultEntityContainer(true).setName("Container").setEntitySets(entitySets);
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.EntitySet

  }

  @Test
  public void twoEntitySetsOneContainerForInfo() throws Exception {
    List<EntitySet> entitySets = new ArrayList<EntitySet>();
    EntitySet entitySet = new EntitySet().setName("Employees");
    entitySets.add(entitySet);
    entitySets.add(entitySet);

    List<EntityContainer> entityContainers = new ArrayList<EntityContainer>();
    EntityContainer container =
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.EntitySet

  public void twoContainersWithOneEntitySetEachForInfo() throws Exception {
    String entitySetUriString = new URI("Employees").toASCIIString();
    String entitySetUriString2 = new URI("Container2.Employees").toASCIIString();

    List<EntitySet> entitySets = new ArrayList<EntitySet>();
    EntitySet entitySet = new EntitySet().setName("Employees");
    entitySets.add(entitySet);

    List<EntityContainer> entityContainers = new ArrayList<EntityContainer>();
    EntityContainer container =
        new EntityContainer().setDefaultEntityContainer(true).setName("Container").setEntitySets(entitySets);
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.EntitySet

  }

  @Test
  public void oneEntitySetsOneContainerTwoSchemadForInfo() throws Exception {
    List<EntitySet> entitySets = new ArrayList<EntitySet>();
    EntitySet entitySet = new EntitySet().setName("Employees");
    entitySets.add(entitySet);

    List<EntityContainer> entityContainers = new ArrayList<EntityContainer>();
    EntityContainer container =
        new EntityContainer().setDefaultEntityContainer(true).setName("Container").setEntitySets(entitySets);
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.EntitySet

  }

  @Test
  public void entitySetTeams() throws Exception {
    // validate teams
    EntitySet teams = aep.getEntitySet(ModelSharedConstants.CONTAINER_1, "Teams");
    assertEquals(ModelSharedConstants.NAMESPACE_1, teams.getEntityType().getNamespace());
    assertEquals("Team", teams.getEntityType().getName());
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.EntitySet

    Association association = new Association().setName("association").setEnd1(end1).setEnd2(end2);
    FullQualifiedName assocName = new FullQualifiedName("namespace", "association");
    when(edmProvider.getAssociation(assocName)).thenReturn(association);

    AssociationSetEnd endSet1 = new AssociationSetEnd().setRole("end1Role").setEntitySet("entitySetRole1");
    when(edmProvider.getEntitySet("Container", "entitySetRole1")).thenReturn(new EntitySet().setName("entitySetRole1"));
    AssociationSetEnd endSet2 = new AssociationSetEnd().setRole("end2Role");

    AssociationSet associationSet =
        new AssociationSet().setName("associationSetName").setAssociation(assocName).setEnd1(endSet1).setEnd2(endSet2);
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.EntitySet

    return associationSets;
  }

  private static List<EntitySet> createEntitySets() {
    List<EntitySet> entitySets = new ArrayList<EntitySet>();
    EntitySet entitySet = new EntitySet();
    entitySet.setName(ENTITY_SET_NAME_ONE);
    entitySet.setEntityType(new FullQualifiedName(NAMESPACE, ENTITY_NAME_ONE));
    entitySets.add(entitySet);
    entitySet = new EntitySet();
    entitySet.setName(ENTITY_SET_NAME_TWO);
    entitySet.setEntityType(new FullQualifiedName(NAMESPACE, ENTITY_NAME_TWO));
    entitySets.add(entitySet);
    return entitySets;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.provider.EntitySet

  @Override
  public EntitySet getEntitySet(final String entityContainer, final String name) throws ODataMessageException {
    if (ENTITY_CONTAINER_1.equals(entityContainer)) {
      if (ES_KEY_IS_STRING.equals(name)) {
        return new EntitySet().setName(name).setEntityType(ET_KEY_IS_STRING);
      } else if (ES_KEY_IS_INTEGER.equals(name)) {
        return new EntitySet().setName(name).setEntityType(ET_KEY_IS_INTEGER);
      } else if (ES_COMPLEX_KEY.equals(name)) {
        return new EntitySet().setName(name).setEntityType(ET_COMPLEX_KEY);
      } else if (ES_ALL_TYPES.equals(name)) {
        return new EntitySet().setName(name).setEntityType(ET_ALL_TYPES);
      } else if (ES_STRING_FACETS.equals(name)) {
        return new EntitySet().setName(name).setEntityType(ET_STRING_FACETS);
      }
    }

    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.