Package org.springframework.data.rest.core.mapping

Examples of org.springframework.data.rest.core.mapping.MappingResourceMetadata


    if (metadata != null) {
      return cacheAndReturn(metadata, property);
    }

    return cacheAndReturn(new MappingResourceMetadata(property.getOwner()), property);
  }
View Full Code Here


  }

  private void assertRootUriFor(String baseUri, String expectedUri) {

    MongoPersistentEntity<?> entity = context.getPersistentEntity(Profile.class);
    ResourceMetadata metadata = new MappingResourceMetadata(entity);

    RepositoryLinkBuilder builder = new RepositoryLinkBuilder(metadata, new BaseUri(baseUri));
    Link link = builder.withSelfRel();

    assertThat(link.getHref(), is(expectedUri));
View Full Code Here

    this.links = new AssociationLinks(mappings);

    this.mappingContext = new MongoMappingContext();
    this.entity = mappingContext.getPersistentEntity(Sample.class);
    this.sampleResourceMetadata = new MappingResourceMetadata(entity);

    when(mappings.getMappingFor(Sample.class)).thenReturn(sampleResourceMetadata);
  }
View Full Code Here

  }

  private PersistentProperty<?> exposeProperty(String name) {

    MongoPersistentProperty property = entity.getPersistentProperty(name);
    ResourceMetadata metadata = new MappingResourceMetadata(mappingContext.getPersistentEntity(property));

    when(mappings.getMappingFor(property.getActualType())).thenReturn(metadata);

    return property;
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.rest.core.mapping.MappingResourceMetadata

Copyright © 2018 www.massapicom. 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.