Examples of PersistentEntityResource


Examples of org.springframework.data.rest.webmvc.PersistentEntityResource

  public void serializesPersonEntity() throws IOException, InterruptedException {

    PersistentEntity<?, ?> persistentEntity = repositories.getPersistentEntity(Person.class);
    Person person = people.save(new Person("John", "Doe"));

    PersistentEntityResource resource = PersistentEntityResource.build(person, persistentEntity).//
        withLink(new Link("/person/" + person.getId())).build();

    StringWriter writer = new StringWriter();
    mapper.writeValue(writer, resource);
View Full Code Here

Examples of org.springframework.data.rest.webmvc.PersistentEntityResource

    User user = new User();
    user.address = new Address();
    user.address.street = "Street";

    PersistentEntityResource userResource = PersistentEntityResource.//
        build(user, repositories.getPersistentEntity(User.class)).//
        withLink(new Link("/users/1")).//
        build();

    PagedResources<PersistentEntityResource> persistentEntityResource = new PagedResources<PersistentEntityResource>(
View Full Code Here

Examples of org.springframework.data.rest.webmvc.PersistentEntityResource

    Order order = new Order(creator);
    order.add(new LineItem("first"));
    order.add(new LineItem("second"));

    PersistentEntityResource orderResource = PersistentEntityResource.//
        build(order, repositories.getPersistentEntity(Order.class)).//
        withLink(new Link("/orders/1")).//
        build();

    PagedResources<PersistentEntityResource> persistentEntityResource = new PagedResources<PersistentEntityResource>(
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.