Examples of Edm


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

   * @see ServiceDocumentProcessor
   */
  @Override
  public ODataResponse readServiceDocument(final GetServiceDocumentUriInfo uriInfo, final String contentType)
      throws ODataException {
    final Edm entityDataModel = getContext().getService().getEntityDataModel();
    final String serviceRoot = getContext().getPathInfo().getServiceRoot().toASCIIString();

    final ODataResponse response = EntityProvider.writeServiceDocument(contentType, entityDataModel, serviceRoot);
    final ODataResponseBuilder odataResponseBuilder = ODataResponse.fromResponse(response).header(
        ODataHttpHeaders.DATASERVICEVERSION, ODataServiceVersion.V10);
View Full Code Here

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

    when(photoContainer.getEntitySet("Photos")).thenReturn(photoEntitySet);
    when(photoContainer.getName()).thenReturn("Container2");

    when(photoEntitySet.getEntityContainer()).thenReturn(photoContainer);

    Edm edm = mock(Edm.class);
    EdmServiceMetadata serviceMetadata = mock(EdmServiceMetadata.class);
    when(serviceMetadata.getDataServiceVersion()).thenReturn("MockEdm");
    when(edm.getServiceMetadata()).thenReturn(serviceMetadata);
    when(edm.getDefaultEntityContainer()).thenReturn(defaultContainer);
    when(edm.getEntityContainer("Container1")).thenReturn(specificContainer);
    when(edm.getEntityContainer("Container2")).thenReturn(photoContainer);
    when(edm.getEntityType("RefScenario", "Employee")).thenReturn(employeeType);
    when(edm.getEntityType("RefScenario", "Team")).thenReturn(teamType);
    when(edm.getEntityType("RefScenario", "Room")).thenReturn(roomType);
    when(edm.getEntityType("RefScenario", "Building")).thenReturn(buildingType);
    when(edm.getComplexType("RefScenario", "c_Location")).thenReturn(locationComplexType);
    when(edm.getEntityType("RefScenario2", "Photo")).thenReturn(photoEntityType);

    return edm;
  }
View Full Code Here

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

  }

  private ExpandSelectTreeNode getSelectExpandTree(final String pathSegment, final String selectString,
      final String expandString) throws Exception {

    Edm edm = RuntimeDelegate.createEdm(new EdmTestProvider());
    UriParserImpl uriParser = new UriParserImpl(edm);

    List<PathSegment> pathSegments = new ArrayList<PathSegment>();
    pathSegments.add(new ODataPathSegmentImpl(pathSegment, null));
View Full Code Here

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

  }

  private ExpandSelectTreeNode getSelectExpandTree(final String selectString, final String expandString)
      throws Exception {

    Edm edm = RuntimeDelegate.createEdm(new EdmTestProvider());
    UriParserImpl uriParser = new UriParserImpl(edm);

    List<PathSegment> pathSegments = new ArrayList<PathSegment>();
    pathSegments.add(new ODataPathSegmentImpl("Employees('1')", null));
View Full Code Here

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

      public Map<String, List<String>> getMatrixParameters() {
        return null;
      }
    };

    final Edm edm = getContext().getService().getEntityDataModel();
    ODataContext context = getContext();
    final int timingHandle = context.startRuntimeMeasurement("UriParser", "parse");

    UriInfo uri = null;
    try {
View Full Code Here

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

  }

  private ExpandSelectTreeNode getSelectExpandTree(final String pathSegment, final String selectString,
      final String expandString) throws Exception {

    Edm edm = RuntimeDelegate.createEdm(new EdmTestProvider());
    UriParserImpl uriParser = new UriParserImpl(edm);

    List<PathSegment> pathSegments = new ArrayList<PathSegment>();
    pathSegments.add(new ODataPathSegmentImpl(pathSegment, null));
View Full Code Here

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

  }

  public final UriInfo parseLinkURI() throws ODataJPARuntimeException {
    UriInfo uriInfo = null;

    Edm edm;
    try {
      edm = context.getODataContext().getService().getEntityDataModel();

      List<PathSegment> pathSegments = context.getODataContext().getPathInfo().getODataSegments();
      List<PathSegment> subPathSegments = pathSegments.subList(0, pathSegments.size() - 2);
View Full Code Here

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

        public Map<String, List<String>> getMatrixParameters() {
          return null;
        }
      };

      final Edm edm = odataContext.getService().getEntityDataModel();

      uri = UriParser.parse(edm, Arrays.asList(pathSegment), Collections.<String, String> emptyMap());

    } catch (ODataException e) {
      throw ODataJPARuntimeException.throwException(ODataJPARuntimeException.GENERAL.addContent(e.getMessage()), e);
View Full Code Here

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

      uriList = EntityProvider.readLinks(contentType, entitySet, content);
      ODataContext odataContext = context.getODataContext();
      final String serviceRoot = odataContext.getPathInfo().getServiceRoot().toString();
      final int length = serviceRoot.length();
      final Edm edm = odataContext.getService().getEntityDataModel();

      for (String uriString : uriList) {
        final String path = uriString.startsWith(serviceRoot) ? uriString.substring(length) : uriString;

        final PathSegment pathSegment = new PathSegment() {
View Full Code Here

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

public class EdmxProviderTest {

  @Test
  public void testEntityType() throws EntityProviderException, ODataException, XMLStreamException {
    Edm edm = createEdm();

    assertNotNull(edm);
    FullQualifiedName fqNameEmployee = new FullQualifiedName("RefScenario", "Employee");
    EdmProvider testProvider = new EdmTestProvider();
    EdmImplProv edmImpl = (EdmImplProv) edm;
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.