Examples of MappingResourceMetadata


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

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

  }

  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

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

    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

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

  }

  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
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.