spring-rest-shell (#2928)

* code snippets for the `Java 9 Stream API improvements` article

* code snippets for the `Java 9 Stream API improvements` article [2 attempt]

* removed the first attempt

* the Spring 5 WebClient

* delted stream features test

* HttpMediaTypeNotAcceptableExceptionExampleController [0]

* reactive web client service was removed

* new WebClient

* new WebClient [2]

* spring-rest-shell init

* pom added

* readme added
This commit is contained in:
Andrew
2017-10-31 18:23:31 +02:00
committed by maibin
parent f9ee21c190
commit 65111a4666
6 changed files with 138 additions and 1 deletions

View File

@@ -0,0 +1,40 @@
package com.baeldung.acticle;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public final class Article {
@Id
@GeneratedValue
private Long id;
private String title;
private String content;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
}

View File

@@ -0,0 +1,18 @@
package com.baeldung.acticle;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import java.util.Optional;
@RepositoryRestResource(
path = "articles",
collectionResourceRel = "articles",
itemResourceRel = "article"
)
public interface ArticleRepository extends CrudRepository<Article, Long> {
Optional<Article> findByTitle(@Param("title") String title);
}