Examples of EdmEntitySet


Examples of org.apache.olingo.odata2.api.annotation.edm.EdmEntitySet

   */
  public String extractEntitySetName(final Class<?> annotatedClass) {
    if (annotatedClass == Object.class) {
      return null;
    }
    EdmEntitySet entitySet = annotatedClass.getAnnotation(EdmEntitySet.class);
    if (entitySet == null) {
      return null;
    }

    String name = entitySet.name();
    if (name.isEmpty()) {
      return getCanonicalName(annotatedClass) + "Set";
    }
    return name;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmEntitySet

                            break;

                        case URI7A:
                            // $links with 0..1 cardinality property
                            // get the response content as String
                            final EdmEntitySet targetLinkEntitySet = uriInfo.getTargetEntitySet();
                            responseHandler.onResponse((T)EntityProvider.readLink(getContentType(),
                                                                                  targetLinkEntitySet, result
                                                                                      .getEntity()
                                                                                      .getContent()));
                            break;

                        case URI7B:
                            // $links with * cardinality property
                            // get the response content as java.util.List<String>
                            final EdmEntitySet targetLinksEntitySet = uriInfo.getTargetEntitySet();
                            responseHandler.onResponse((T)EntityProvider.readLinks(getContentType(),
                                                                                   targetLinksEntitySet,
                                                                                   result.getEntity()
                                                                                       .getContent()));
                            break;
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmEntitySet

            response = EntityProvider.writeProperty(responseContentType, complexProperty, content);
            break;

        case URI7A:
            // $links with 0..1 cardinality property
            final EdmEntitySet targetLinkEntitySet = uriInfo.getTargetEntitySet();
            EntityProviderWriteProperties linkProperties =
                EntityProviderWriteProperties.serviceRoot(new URI(serviceUri + SEPARATOR)).build();
            @SuppressWarnings("unchecked")
            final Map<String, Object> linkMap = (Map<String, Object>) content;
            response = EntityProvider.writeLink(responseContentType, targetLinkEntitySet, linkMap, linkProperties);
            break;

        case URI7B:
            // $links with * cardinality property
            final EdmEntitySet targetLinksEntitySet = uriInfo.getTargetEntitySet();
            EntityProviderWriteProperties linksProperties =
                EntityProviderWriteProperties.serviceRoot(new URI(serviceUri + SEPARATOR)).build();
            @SuppressWarnings("unchecked")
            final List<Map<String, Object>> linksMap = (List<Map<String, Object>>) content;
            response = EntityProvider.writeLinks(responseContentType, targetLinksEntitySet, linksMap, linksProperties);
            break;

        case URI1:
        case URI2:
        case URI6A:
        case URI6B:
            // Entity
            final EdmEntitySet targetEntitySet = uriInfo.getTargetEntitySet();
            EntityProviderWriteProperties properties =
                EntityProviderWriteProperties.serviceRoot(new URI(serviceUri + SEPARATOR)).build();
            @SuppressWarnings("unchecked")
            final Map<String, Object> objectMap = (Map<String, Object>) content;
            response = EntityProvider.writeEntry(responseContentType, targetEntitySet, objectMap, properties);
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmEntitySet

            if (entityContainer == null) {
                throw new IllegalArgumentException("EDM does not have a default entity container"
                    + ", use a fully qualified entity set name");
            }
        }
        final EdmEntitySet entitySet = entityContainer.getEntitySet(referencedEntityName);
        final List<EdmProperty> keyProperties = entitySet.getEntityType().getKeyProperties();

        if (keyProperties.size() == 1) {
            referencedEntity.append("('dummy')");
        } else {
            referencedEntity.append("(");
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmEntitySet

    return entityContainerInfo.getName();
  }

  @Override
  public EdmEntitySet getEntitySet(final String name) throws EdmException {
    EdmEntitySet edmEntitySet = edmEntitySets.get(name);
    if (edmEntitySet != null) {
      return edmEntitySet;
    }

    EntitySet entitySet;
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmEntitySet

   * @param entitySet based on which the {@link EdmEntitySet} is created
   * @return the created and cached {@link EdmEntitySet}
   * @throws EdmException
   */
  private EdmEntitySet createEntitySet(final EntitySet entitySet) throws EdmException {
    EdmEntitySet edmEntitySet = new EdmEntitySetImplProv(edm, entitySet, this);
    edmEntitySets.put(entitySet.getName(), edmEntitySet);
    return edmEntitySet;
  }
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmEntitySet

      List<EdmEntitySet> edmEntitySets = new ArrayList<EdmEntitySet>();
      List<EntityContainer> entityContainerHierachy = getEntityContainerHierachy();
      for (EntityContainer entityContainer : entityContainerHierachy) {
        List<EntitySet> entitySets = entityContainer.getEntitySets();
        for (EntitySet entitySet : entitySets) {
          EdmEntitySet ees = createEntitySet(entitySet);
          edmEntitySets.add(ees);
        }
      }
      return edmEntitySets;
    } catch (ODataException e) {
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmEntitySet

  }

  @Test
  public void createEntryWithLink() throws Exception {
    HttpResponse response = callUri("$metadata");
    final EdmEntitySet linkedEntitySet = EntityProvider.readMetadata(response.getEntity().getContent(), false)
        .getDefaultEntityContainer().getEntitySet("Rooms");
    getBody(response);
    Map<String, Object> data = new HashMap<String, Object>();
    data.put("Id", "99");
    data.put("Name", "new room");
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmEntitySet

  private JPAEntity jpaEntity = null;

  @Test
  public void testCreateODataEntryWithComplexType() {
    try {
      EdmEntitySet edmEntitySet = EdmMockUtilV2.mockEdmEntitySet(JPATypeMock.ENTITY_NAME, true);
      EdmEntityType edmEntityType = edmEntitySet.getEntityType();

      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, mockODataJPAContext());
      jpaEntity.create(ODataEntryMockUtil.mockODataEntryWithComplexType(JPATypeMock.ENTITY_NAME));
    } catch (ODataJPARuntimeException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
View Full Code Here

Examples of org.apache.olingo.odata2.api.edm.EdmEntitySet

  }

  @Test
  public void testCreateODataEntry() {
    try {
      EdmEntitySet edmEntitySet = EdmMockUtilV2.mockEdmEntitySet(JPATypeMock.ENTITY_NAME, false);
      EdmEntityType edmEntityType = edmEntitySet.getEntityType();

      jpaEntity = new JPAEntity(edmEntityType, edmEntitySet, mockODataJPAContext());
      jpaEntity.create(ODataEntryMockUtil.mockODataEntry(JPATypeMock.ENTITY_NAME));
    } catch (ODataJPARuntimeException e) {
      fail(ODataJPATestConstants.EXCEPTION_MSG_PART_1 + e.getMessage()
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.