Giter VIP home page Giter VIP logo

embeddable-spring-data-rest's Introduction

embeddable-spring-data-rest

An example of using Spring Data REST with an embeddable subtable

NOTE: This has been udpated to Spring Boot 1.1.1.RELEASE, which includes Spring Data REST 2.1.0.RELEASE and Spring Data JPA 1.6.0.RELEASE.

Run it by launching mvn clean spring-boot:run.

To poke at the sample data, in another shell, use curl.

$ curl localhost:8080/systems/1
{
  "name" : "router101",
  "dependencies" : [ {
    "description" : "WLAN"
  }, {
    "description" : "UPS"
  } ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/systems/1"
    }
  }
}
$ curl -X PATCH -H "Content-type:application/json" -d '{ "dependencies" : [{"description":"MUX", "target": "http://localhost:8080/systems/1"}]}' localhost:8080/systems/1
$ curl localhost:8080/systems/1
{
  "name" : "router101",
  "dependencies" : [ {
    "description" : "MUX"
  } ],
  "_links" : {
    "self" : {
      "href" : "http://localhost:8080/systems/1"
    }
  }
}

Looking at the outpout from the IDE, you can see it is clearly interacting with the two tables properly.

embeddable-spring-data-rest's People

Contributors

gregturn avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

embeddable-spring-data-rest's Issues

Update of embeddable works but view does not bring the "target" attribute

The update of the embeddable objects works well. When viewing the data, the target property of SystemDependency is not shown:

{
  "_embedded" : {
    "systems" : [ {
      "name" : "router101",
      "dependencies" : [ {
        "description" : "WLAN"
      }, {
        "description" : "UPS"
      } ],
      "_links" : {
        "self" : {
          "href" : "http://localhost:8080/systems/1"
        }
      }
    } ]
  }
}

The WLAN or UPS dependencies could be on other systems.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.