https://github.com/gregturn/embeddable-spring-data-rest
An example of using Spring Data REST with an embeddable subtable
https://github.com/gregturn/embeddable-spring-data-rest
Last synced: 10 months ago
JSON representation
An example of using Spring Data REST with an embeddable subtable
- Host: GitHub
- URL: https://github.com/gregturn/embeddable-spring-data-rest
- Owner: gregturn
- Created: 2014-05-12T04:55:23.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-07-12T02:59:44.000Z (almost 12 years ago)
- Last Synced: 2025-06-27T10:07:21.214Z (11 months ago)
- Language: Java
- Size: 219 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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.