Skip to content

Commit d932245

Browse files
committed
[docs] Publishing the docs for commit(s) c83e3d3
1 parent bbfef4f commit d932245

12 files changed

Lines changed: 384 additions & 423 deletions

quarkus-tutorial/04_panache.html

Lines changed: 102 additions & 131 deletions
Large diffs are not rendered by default.

quarkus-tutorial/06_dev-services.html

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -301,25 +301,20 @@ <h2 id="_verify_postgresql_container_is_running"><a class="anchor" href="#_verif
301301
</div>
302302
</div>
303303
<div class="paragraph">
304-
<p>Call the fruit endpoint again. The data is now coming from the PostgreSQL database container.</p>
304+
<p>Call the movie endpoint again. The data is now coming from the PostgreSQL database container.</p>
305305
</div>
306306
<div class="listingblock console-input">
307307
<div class="content">
308-
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">curl -w '\n' localhost:8080/fruit?season=Spring</code></pre>
308+
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">curl -w '\n' localhost:8080/movie?year=1980</code></pre>
309309
</div>
310310
</div>
311311
<div class="listingblock console-output">
312312
<div class="content">
313313
<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">[
314-
{
315-
"id": 1,
316-
"name": "Mango",
317-
"season": "Spring"
318-
},
319314
{
320315
"id": 2,
321-
"name": "Strawberry",
322-
"season": "Spring"
316+
"title": "The Empire Strikes Back",
317+
"releaseDate": "1980-05-17"
323318
}
324319
]</code></pre>
325320
</div>

quarkus-tutorial/07_spring.html

Lines changed: 19 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -231,10 +231,10 @@ <h2 id="_adding_the_spring_compatibility_extensions"><a class="anchor" href="#_a
231231
</div>
232232
</div>
233233
<div class="sect1">
234-
<h2 id="_create_a_spring_data_repository_for_fruit"><a class="anchor" href="#_create_a_spring_data_repository_for_fruit"></a>Create a Spring Data Repository for Fruit</h2>
234+
<h2 id="_create_a_spring_data_repository_for_movie"><a class="anchor" href="#_create_a_spring_data_repository_for_movie"></a>Create a Spring Data Repository for Movie</h2>
235235
<div class="sectionbody">
236236
<div class="paragraph">
237-
<p>Spring Data is one of the most popular Spring APIs, so let&#8217;s create a Spring Data JPA Repository for our <code>Fruit</code> entity. Create the <code>SpringFruitRepository</code> Java class in <code>src/main/java</code> in the <code>com.redhat.developers</code> package with the following contents:</p>
237+
<p>Spring Data is one of the most popular Spring APIs, so let&#8217;s create a Spring Data JPA Repository for our <code>Movie</code> entity. Create the <code>SpringMovieRepository</code> Java class in <code>src/main/java</code> in the <code>com.redhat.developers</code> package with the following contents:</p>
238238
</div>
239239
<div class="listingblock console-input">
240240
<div class="content">
@@ -246,9 +246,9 @@ <h2 id="_create_a_spring_data_repository_for_fruit"><a class="anchor" href="#_cr
246246
import org.springframework.stereotype.Repository;
247247

248248
@Repository
249-
public interface SpringFruitRepository extends JpaRepository&lt;Fruit, Long&gt; {
249+
public interface SpringMovieRepository extends JpaRepository&lt;Movie, Long&gt; {
250250

251-
public List&lt;Fruit&gt; findBySeason(String season);
251+
public List&lt;Movie&gt; findByYear(String year);
252252

253253
}</code></pre>
254254
</div>
@@ -259,7 +259,7 @@ <h2 id="_create_a_spring_data_repository_for_fruit"><a class="anchor" href="#_cr
259259
<h2 id="_create_a_spring_rest_controller"><a class="anchor" href="#_create_a_spring_rest_controller"></a>Create a Spring REST Controller</h2>
260260
<div class="sectionbody">
261261
<div class="paragraph">
262-
<p>Now let&#8217;s create another REST endpoint for <code>Fruit</code>, but now using the Spring Web APIs. Create the <code>FruitController</code> Java class in <code>src/main/java</code> in the <code>com.redhat.developers</code> package with the following contents:</p>
262+
<p>Now let&#8217;s create another REST endpoint for <code>Movie</code>, but now using the Spring Web APIs. Create the <code>MovieController</code> Java class in <code>src/main/java</code> in the <code>com.redhat.developers</code> package with the following contents:</p>
263263
</div>
264264
<div class="listingblock console-input">
265265
<div class="content">
@@ -273,51 +273,41 @@ <h2 id="_create_a_spring_rest_controller"><a class="anchor" href="#_create_a_spr
273273
import org.springframework.web.bind.annotation.RestController;
274274

275275
@RestController
276-
@RequestMapping(path = "/spring-fruit")
277-
public class FruitController {
276+
@RequestMapping(path = "/spring-movie")
277+
public class MovieController {
278278

279-
private SpringFruitRepository fruitRepository;
279+
private SpringMovieRepository movieRepository;
280280

281-
public FruitController(SpringFruitRepository fruitRepository) {
282-
this.fruitRepository = fruitRepository;
281+
public MovieController(SpringMovieRepository movieRepository) {
282+
this.movieRepository = movieRepository;
283283
}
284284

285285
@GetMapping
286-
public List&lt;Fruit&gt; fruits(@RequestParam("season") String season) {
287-
if (season != null) {
288-
return fruitRepository.findBySeason(season);
286+
public List&lt;Movie&gt; movies(@RequestParam("year") String year) {
287+
if (year != null) {
288+
return movieRepository.findByYear(year);
289289
}
290-
return fruitRepository.findAll();
290+
return movieRepository.findAll();
291291
}
292292

293293
}</code></pre>
294294
</div>
295295
</div>
296296
<div class="paragraph">
297-
<p>Let&#8217;s try to filter only the fruits with the <strong>Summer</strong> season. Don&#8217;t forget to start Quarkus dev mode again if you stopped it.</p>
297+
<p>Let&#8217;s try to filter only the movies with year <strong>1980</strong>. Don&#8217;t forget to start Quarkus dev mode again if you stopped it.</p>
298298
</div>
299299
<div class="listingblock console-input">
300300
<div class="content">
301-
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">curl -w '\n' localhost:8080/spring-fruit?season=Summer</code></pre>
301+
<pre class="highlightjs highlight"><code class="language-bash hljs" data-lang="bash">curl -w '\n' localhost:8080/spring-movie?year=1980</code></pre>
302302
</div>
303303
</div>
304304
<div class="listingblock console-output">
305305
<div class="content">
306306
<pre class="highlightjs highlight"><code class="language-json hljs" data-lang="json">[
307307
{
308-
"id": 5,
309-
"name": "Blueberry",
310-
"season": "Summer"
311-
},
312-
{
313-
"id": 6,
314-
"name": "Banana",
315-
"season": "Summer"
316-
},
317-
{
318-
"id": 7,
319-
"name": "Plum",
320-
"season": "Summer"
308+
"id": 2,
309+
"title": "The Empire Strikes Back",
310+
"releaseDate": "1980-05-17"
321311
}
322312
]</code></pre>
323313
</div>

0 commit comments

Comments
 (0)