{"id":225,"date":"2019-07-05T10:37:14","date_gmt":"2019-07-05T01:37:14","guid":{"rendered":"http:\/\/2019se3.satoshis.jp\/?p=225"},"modified":"2019-07-05T12:50:13","modified_gmt":"2019-07-05T03:50:13","slug":"7%e6%9c%885%e6%97%a5","status":"publish","type":"post","link":"https:\/\/2019se3.satoshis.jp\/?p=225","title":{"rendered":"7\u67085\u65e5"},"content":{"rendered":"<h3>\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8\u3092\u767b\u9332\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/h3>\n<p>\u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<p>PlayListRepository.java<\/p>\n<pre class=\"brush: java; title: ; notranslate\" title=\"\">\r\npackage jp.abc;\r\n\r\nimport org.springframework.data.jpa.repository.JpaRepository;\r\n\r\npublic interface PlayListRepository extends JpaRepository&lt;PlayList, Long&gt; {\r\n\r\n}\r\n<\/pre>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u304c\u3001GET\u3068POST\u30e1\u30bd\u30c3\u30c9\u3092\u53d7\u3051\u53d6\u308b\u3088\u3046\u306b\u4fee\u6b63\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; highlight: [17,18,20,25,26,30,31,32,33,34,35,36,37,38,39,40,41]; title: ; notranslate\" title=\"\">\r\npackage jp.abc;\r\n\r\nimport java.util.List;\r\n\r\nimport org.springframework.beans.factory.annotation.Autowired;\r\nimport org.springframework.stereotype.Controller;\r\nimport org.springframework.validation.Errors;\r\nimport org.springframework.validation.annotation.Validated;\r\nimport org.springframework.web.bind.annotation.ModelAttribute;\r\nimport org.springframework.web.bind.annotation.RequestMapping;\r\nimport org.springframework.web.bind.annotation.RequestMethod;\r\nimport org.springframework.web.servlet.ModelAndView;\r\n\r\n@Controller\r\npublic class PlayListController {\r\n\r\n\t@Autowired\r\n\tprivate PlayListRepository repository;\r\n\r\n\t@RequestMapping(value = &quot;\/playlist&quot;, method = RequestMethod.GET)\r\n\tpublic ModelAndView list(ModelAndView mav) {\r\n\t\tmav.setViewName(&quot;playlist&quot;);\r\n\t\tPlayList pl = new PlayList();\r\n\t\tmav.addObject(&quot;formModel&quot;, pl);\r\n\t\tList&lt;PlayList&gt; list = repository.findAll();\r\n\t\tmav.addObject(&quot;datalist&quot;, list);\r\n\t\treturn mav;\r\n\t}\r\n\r\n\t@RequestMapping(value = &quot;playlist&quot;, method = RequestMethod.POST)\r\n\tpublic ModelAndView post(\r\n\t\t\t@ModelAttribute(&quot;formModel&quot;) @Validated PlayList playlist,\r\n\t\t\tErrors result,\r\n\t\t\tModelAndView mav) {\r\n\t\tif (result.hasErrors()) {\r\n\t\t\tmav.addObject(&quot;msg&quot;, &quot;\u30a8\u30e9\u30fc\u3067\u3059\u3088&quot;);\r\n\t\t\treturn mav;\r\n\t\t}\r\n\t\trepository.saveAndFlush(playlist);\r\n\t\treturn new ModelAndView(&quot;redirect:\/playlist&quot;);\r\n\t}\r\n}\r\n<\/pre>\n<p>HTML\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4fee\u6b63\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; highlight: [43,68]; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html xmlns:th=&quot;http:\/\/www.thymeleaf.org&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8&lt;\/title&gt;\r\n&lt;style type=&quot;text\/css&quot;&gt;\r\nh1 {\r\n  font-size: 18pt;\r\n  font-weight: bold;\r\n  color: gray;\r\n}\r\nbody {\r\n  font-size: 13pt;\r\n  color: gray;\r\n  margin: 5px 25px;\r\n}\r\npre {\r\n  border: solid 3px #ddd;\r\n  padding: 10px;\r\n}\r\ntr {\r\n  margin: 5px;\r\n}\r\nth {\r\n  padding: 5px;\r\n  color: white;\r\n  background: darkgray;\r\n}\r\ntd {\r\n  padding: 5px;\r\n  color: black;\r\n  background: #f0f0f0;\r\n}\r\n.err {\r\n  color: red;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8&lt;\/h1&gt;\r\n&lt;p th:text=&quot;${msg}&quot;&gt;&lt;\/p&gt;\r\n&lt;form method=&quot;post&quot; action=&quot;\/playlist&quot; th:object=&quot;${formModel}&quot;&gt;\r\n  &lt;table&gt;\r\n    &lt;tr&gt;\r\n      &lt;td&gt;&lt;label for=&quot;name&quot;&gt;\u540d\u524d&lt;\/label&gt;&lt;\/td&gt;\r\n      &lt;td&gt;\r\n        &lt;input type=&quot;text&quot; name=&quot;name&quot; th:value=&quot;*{name}&quot;\r\n      \t\t\tth:errorclass=&quot;err&quot; \/&gt;\r\n      \t&lt;div th:if=&quot;${#fields.hasErrors('name')}&quot; th:errors=&quot;*{name}&quot;\r\n      \t\tth:errorclass=&quot;err&quot;&gt;&lt;\/div&gt;\r\n      &lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n    &lt;tr&gt;\r\n      &lt;td&gt;&lt;\/td&gt;\r\n      &lt;td&gt;&lt;input type=&quot;submit&quot; \/&gt;&lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n  &lt;\/table&gt;\r\n&lt;\/form&gt;\r\n\r\n&lt;hr \/&gt;\r\n&lt;table&gt;\r\n  &lt;tr&gt;\r\n    &lt;th&gt;ID&lt;\/th&gt;&lt;th&gt;\u540d\u524d&lt;\/th&gt;\r\n  &lt;\/tr&gt;\r\n  &lt;tr th:each=&quot;obj : ${datalist}&quot;&gt;\r\n    &lt;td th:text=&quot;${obj.id}&quot;&gt;&lt;\/td&gt;\r\n    &lt;td th:text=&quot;${obj.name}&quot;&gt;&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<h3>PlayList\u3068Music\u3092\u9023\u643a\u3059\u308b<\/h3>\n<p>Music\u304b\u3089PlayList\u3078\u306e\u95a2\u9023\u6027\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; highlight: [28,29,60,61,62,63,64,65,66]; title: ; notranslate\" title=\"\">\r\npackage jp.abc;\r\n\r\nimport javax.persistence.Column;\r\nimport javax.persistence.Entity;\r\nimport javax.persistence.GeneratedValue;\r\nimport javax.persistence.GenerationType;\r\nimport javax.persistence.Id;\r\nimport javax.persistence.ManyToOne;\r\nimport javax.validation.constraints.NotEmpty;\r\nimport javax.validation.constraints.NotNull;\r\n\r\n@Entity\r\npublic class Music {\r\n\t@Id\r\n\t@GeneratedValue(strategy = GenerationType.AUTO)\r\n\t@Column\r\n\t@NotNull\r\n\tprivate long id;\r\n\r\n\t@Column(length = 200, nullable = false)\r\n\t@NotEmpty\r\n\tprivate String title;\r\n\r\n\t@Column(length = 200, nullable = false)\r\n\t@NotEmpty\r\n\tprivate String artist;\r\n\r\n\t@ManyToOne\r\n\tprivate PlayList playlist;\r\n\r\n\tpublic long getId() {\r\n\t\treturn id;\r\n\t}\r\n\r\n\tpublic void setId(long id) {\r\n\t\tthis.id = id;\r\n\t}\r\n\r\n\tpublic String getTitle() {\r\n\t\treturn title;\r\n\t}\r\n\r\n\tpublic void setTitle(String title) {\r\n\t\tthis.title = title;\r\n\t}\r\n\r\n\tpublic String getArtist() {\r\n\t\treturn artist;\r\n\t}\r\n\r\n\tpublic void setArtist(String artist) {\r\n\t\tthis.artist = artist;\r\n\t}\r\n\r\n\t@Override\r\n\tpublic String toString() {\r\n\t\treturn &quot;Music [title=&quot; + title + &quot;, artist=&quot; + artist + &quot;]&quot;;\r\n\t}\r\n\r\n\tpublic PlayList getPlaylist() {\r\n\t\treturn playlist;\r\n\t}\r\n\r\n\tpublic void setPlaylist(PlayList playlist) {\r\n\t\tthis.playlist = playlist;\r\n\t}\r\n\r\n}\r\n<\/pre>\n<p>PlayList\u304b\u3089Music\u3078\u306e\u95a2\u9023\u6027\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; highlight: [26,27,45,46,47,48,49,50,51]; title: ; notranslate\" title=\"\">\r\npackage jp.abc;\r\n\r\nimport java.util.List;\r\n\r\nimport javax.persistence.Column;\r\nimport javax.persistence.Entity;\r\nimport javax.persistence.GeneratedValue;\r\nimport javax.persistence.GenerationType;\r\nimport javax.persistence.Id;\r\nimport javax.persistence.OneToMany;\r\nimport javax.validation.constraints.NotEmpty;\r\nimport javax.validation.constraints.NotNull;\r\n\r\n@Entity\r\npublic class PlayList {\r\n\t@Id\r\n\t@GeneratedValue(strategy = GenerationType.AUTO)\r\n\t@Column\r\n\t@NotNull\r\n\tprivate long id;\r\n\r\n\t@Column(length = 200, nullable = false)\r\n\t@NotEmpty\r\n\tprivate String name;\r\n\r\n\t@OneToMany\r\n\tprivate List&lt;Music&gt; musics;\r\n\r\n\tpublic long getId() {\r\n\t\treturn id;\r\n\t}\r\n\r\n\tpublic void setId(long id) {\r\n\t\tthis.id = id;\r\n\t}\r\n\r\n\tpublic String getName() {\r\n\t\treturn name;\r\n\t}\r\n\r\n\tpublic void setName(String name) {\r\n\t\tthis.name = name;\r\n\t}\r\n\r\n\tpublic List&lt;Music&gt; getMusics() {\r\n\t\treturn musics;\r\n\t}\r\n\r\n\tpublic void setMusics(List&lt;Music&gt; musics) {\r\n\t\tthis.musics = musics;\r\n\t}\r\n\r\n\r\n}\r\n<\/pre>\n<p>Music \u3092\u767b\u9332\u3059\u308bHTML\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 index.html \u306b\u3001\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8\u3092\u8a2d\u5b9a\u3059\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; highlight: [63,64,65,66,67,68,69,70,71]; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html xmlns:th=&quot;http:\/\/www.thymeleaf.org&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;\u30df\u30e5\u30fc\u30b8\u30c3\u30af\u30d7\u30ec\u30a4\u30e4\u30fc&lt;\/title&gt;\r\n&lt;style type=&quot;text\/css&quot;&gt;\r\nh1 {\r\n  font-size: 18pt;\r\n  font-weight: bold;\r\n  color: gray;\r\n}\r\nbody {\r\n  font-size: 13pt;\r\n  color: gray;\r\n  margin: 5px 25px;\r\n}\r\npre {\r\n  border: solid 3px #ddd;\r\n  padding: 10px;\r\n}\r\ntr {\r\n  margin: 5px;\r\n}\r\nth {\r\n  padding: 5px;\r\n  color: white;\r\n  background: darkgray;\r\n}\r\ntd {\r\n  padding: 5px;\r\n  color: black;\r\n  background: #f0f0f0;\r\n}\r\n.err {\r\n  color: red;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;\u30df\u30e5\u30fc\u30b8\u30c3\u30af\u30d7\u30ec\u30a4\u30e4\u30fc&lt;\/h1&gt;\r\n&lt;p th:text=&quot;${msg}&quot;&gt;&lt;\/p&gt;\r\n&lt;form method=&quot;post&quot; action=&quot;\/&quot; th:object=&quot;${formModel}&quot;&gt;\r\n  &lt;table&gt;\r\n    &lt;tr&gt;\r\n      &lt;td&gt;&lt;label for=&quot;title&quot;&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/label&gt;&lt;\/td&gt;\r\n      &lt;td&gt;\r\n        &lt;input type=&quot;text&quot; name=&quot;title&quot; th:value=&quot;*{title}&quot;\r\n      \t\t\tth:errorclass=&quot;err&quot; \/&gt;\r\n      \t&lt;div th:if=&quot;${#fields.hasErrors('title')}&quot; th:errors=&quot;*{title}&quot;\r\n      \t\tth:errorclass=&quot;err&quot;&gt;&lt;\/div&gt;\r\n      &lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n    &lt;tr&gt;\r\n      &lt;td&gt;&lt;label for=&quot;artist&quot;&gt;\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8&lt;\/label&gt;&lt;\/td&gt;\r\n      &lt;td&gt;\r\n        &lt;input type=&quot;text&quot; name=&quot;artist&quot; th:value=&quot;*{artist}&quot;\r\n      \t\t\tth:errorclass=&quot;err&quot;\/&gt;\r\n      \t&lt;div th:if=&quot;${#fields.hasErrors('artist')}&quot; th:errors=&quot;*{artist}&quot;\r\n      \t\tth:errorclass=&quot;err&quot;&gt;&lt;\/div&gt;\r\n      &lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n    &lt;tr&gt;\r\n      &lt;td&gt;&lt;label for=&quot;playlist&quot;&gt;\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8&lt;\/label&gt;&lt;\/td&gt;\r\n      &lt;td&gt;\r\n        &lt;input type=&quot;text&quot; name=&quot;playlist&quot; th:value=&quot;*{playlist}&quot;\r\n      \t\t\tth:errorclass=&quot;err&quot;\/&gt;\r\n      \t&lt;div th:if=&quot;${#fields.hasErrors('playlist')}&quot; th:errors=&quot;*{playlist}&quot;\r\n      \t\tth:errorclass=&quot;err&quot;&gt;&lt;\/div&gt;\r\n      &lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n    &lt;tr&gt;\r\n      &lt;td&gt;&lt;\/td&gt;\r\n      &lt;td&gt;&lt;input type=&quot;submit&quot; \/&gt;&lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n  &lt;\/table&gt;\r\n&lt;\/form&gt;\r\n\r\n&lt;hr \/&gt;\r\n&lt;table&gt;\r\n  &lt;tr&gt;\r\n    &lt;th&gt;ID&lt;\/th&gt;&lt;th&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/th&gt;&lt;th&gt;\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8&lt;\/th&gt;&lt;th&gt;\u7de8\u96c6&lt;\/th&gt;&lt;th&gt;\u524a\u9664&lt;\/th&gt;\r\n  &lt;\/tr&gt;\r\n  &lt;tr th:each=&quot;obj : ${datalist}&quot;&gt;\r\n    &lt;td th:text=&quot;${obj.id}&quot;&gt;&lt;\/td&gt;\r\n    &lt;td th:text=&quot;${obj.title}&quot;&gt;&lt;\/td&gt;\r\n    &lt;td th:text=&quot;${obj.artist}&quot;&gt;&lt;\/td&gt;\r\n    &lt;td&gt;&lt;a th:href=&quot;@{'\/edit\/' + ${obj.id}}&quot;&gt;\u7de8\u96c6&lt;\/a&gt;&lt;\/td&gt;\r\n    &lt;td&gt;&lt;a th:href=&quot;@{'\/delete\/' + ${obj.id}}&quot;&gt;\u524a\u9664&lt;\/a&gt;&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>\u5165\u529b\u30d5\u30a9\u30fc\u30e0\u306e\u4e0b\u306b\u3001Music\u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3057\u3066\u3044\u308b\u304c\u3001\u305d\u3053\u306b\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8\u540d\u3092\u8868\u793a\u3059\u308b\u3002<br \/>\n\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8\u304cnull\u306e\u5834\u5408\u306f\u300c\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8\u306a\u3057\u300d\u3068\u8868\u793a\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; first-line: 79; highlight: [88,89]; title: ; notranslate\" title=\"\">\r\n&lt;hr \/&gt;\r\n&lt;table&gt;\r\n  &lt;tr&gt;\r\n    &lt;th&gt;ID&lt;\/th&gt;&lt;th&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/th&gt;&lt;th&gt;\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8&lt;\/th&gt;&lt;th&gt;\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8&lt;\/th&gt;&lt;th&gt;\u7de8\u96c6&lt;\/th&gt;&lt;th&gt;\u524a\u9664&lt;\/th&gt;\r\n  &lt;\/tr&gt;\r\n  &lt;tr th:each=&quot;obj : ${datalist}&quot;&gt;\r\n    &lt;td th:text=&quot;${obj.id}&quot;&gt;&lt;\/td&gt;\r\n    &lt;td th:text=&quot;${obj.title}&quot;&gt;&lt;\/td&gt;\r\n    &lt;td th:text=&quot;${obj.artist}&quot;&gt;&lt;\/td&gt;\r\n    &lt;td th:if=&quot;${obj.playlist != null}&quot; th:text=&quot;${obj.playlist.name}&quot;&gt;&lt;\/td&gt;\r\n    &lt;td th:if=&quot;${obj.playlist == null}&quot; th:text=&quot;\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8\u306a\u3057&quot;&gt;&lt;\/td&gt;\r\n    &lt;td&gt;&lt;a th:href=&quot;@{'\/edit\/' + ${obj.id}}&quot;&gt;\u7de8\u96c6&lt;\/a&gt;&lt;\/td&gt;\r\n    &lt;td&gt;&lt;a th:href=&quot;@{'\/delete\/' + ${obj.id}}&quot;&gt;\u524a\u9664&lt;\/a&gt;&lt;\/td&gt;\r\n  &lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n<\/pre>\n<p>Music\u3092\u7de8\u96c6\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<p>\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u3067\u7de8\u96c6\u306eURL\u3092\u53d7\u3051\u4ed8\u3051\u308b\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<pre class=\"brush: java; first-line: 46; title: ; notranslate\" title=\"\">\r\n\t@RequestMapping(value = &quot;\/edit\/{id}&quot;)\r\n\tpublic ModelAndView edit(@ModelAttribute Music music,\r\n\t\t\t@PathVariable long id,\r\n\t\t\tModelAndView mav) {\r\n\t\tmav.setViewName(&quot;edit&quot;);\r\n\t\tmav.addObject(&quot;title&quot;, &quot;edit music&quot;);\r\n\t\tOptional&lt;Music&gt; data = repository.findById(id);\r\n\t\tmav.addObject(&quot;formModel&quot;, data.get());\r\n\t\treturn mav;\r\n\t}\r\n<\/pre>\n<p>HTML\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8 edit.html \u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<pre class=\"brush: xml; title: ; notranslate\" title=\"\">\r\n&lt;!DOCTYPE html&gt;\r\n&lt;html xmlns:th=&quot;http:\/\/www.thymeleaf.org&quot;&gt;\r\n&lt;head&gt;\r\n&lt;meta charset=&quot;UTF-8&quot;&gt;\r\n&lt;title&gt;top page&lt;\/title&gt;\r\n&lt;meta http-equiv=&quot;Content-type&quot; content=&quot;text\/html; charset=UTF-8&quot; \/&gt;\r\n&lt;style type=&quot;text\/css&quot;&gt;\r\nh1 {\r\n  font-size: 18pt;\r\n  font-weight: bold;\r\n  color: gray;\r\n}\r\nbody {\r\n  font-size: 13pt;\r\n  color: gray;\r\n  margin: 5px 25px;\r\n}\r\npre {\r\n  border: solid 3px #ddd;\r\n  padding: 10px;\r\n}\r\ntr {\r\n  margin: 5px;\r\n}\r\nth {\r\n  padding: 5px;\r\n  color: white;\r\n  background: darkgray;\r\n}\r\ntd {\r\n  padding: 5px;\r\n  color: black;\r\n  background: #f0f0f0;\r\n}\r\n&lt;\/style&gt;\r\n&lt;\/head&gt;\r\n&lt;body&gt;\r\n\r\n&lt;h1&gt;Music edit page&lt;\/h1&gt;\r\n\r\n&lt;form method=&quot;post&quot; action=&quot;\/edit&quot; th:object=&quot;${formModel}&quot;&gt;\r\n  &lt;input type=&quot;hidden&quot; name=&quot;id&quot; th:value=&quot;*{id}&quot; \/&gt;\r\n  &lt;table&gt;\r\n    &lt;tr&gt;\r\n      &lt;td&gt;&lt;label for=&quot;title&quot;&gt;\u30bf\u30a4\u30c8\u30eb&lt;\/label&gt;&lt;\/td&gt;\r\n      &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;title&quot; th:value=&quot;*{title}&quot; \/&gt;&lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n    &lt;tr&gt;\r\n      &lt;td&gt;&lt;label for=&quot;artist&quot;&gt;\u30a2\u30fc\u30c6\u30a3\u30b9\u30c8&lt;\/label&gt;&lt;\/td&gt;\r\n      &lt;td&gt;&lt;input type=&quot;text&quot; name=&quot;artist&quot; th:value=&quot;*{artist}&quot; \/&gt;&lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n    &lt;tr&gt;\r\n      &lt;td&gt;&lt;label for=&quot;playlist&quot;&gt;\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8&lt;\/label&gt;&lt;\/td&gt;\r\n      &lt;td th:if=&quot;*{playlist != null}&quot;&gt;\r\n        &lt;input type=&quot;text&quot; name=&quot;playlist&quot; th:value=&quot;*{playlist.id}&quot; \/&gt;\r\n      &lt;\/td&gt;\r\n      &lt;td th:if=&quot;*{playlist == null}&quot;&gt;\r\n        &lt;input type=&quot;text&quot; name=&quot;playlist&quot; value=&quot;&quot; \/&gt;\r\n      &lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n    &lt;tr&gt;\r\n      &lt;td&gt;&lt;\/td&gt;\r\n      &lt;td&gt;&lt;input type=&quot;submit&quot; \/&gt;&lt;\/td&gt;\r\n    &lt;\/tr&gt;\r\n  &lt;\/table&gt;\r\n&lt;\/form&gt;\r\n\r\n\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>MusicController \u3067 POST\u3092\u53d7\u3051\u4ed8\u3051\u308b\u3002<\/p>\n<pre class=\"brush: java; first-line: 57; title: ; notranslate\" title=\"\">\r\n\t@RequestMapping(value = &quot;\/edit&quot;, method = RequestMethod.POST)\r\n\tpublic ModelAndView form(@ModelAttribute @Validated Music music,\r\n\t\t\tErrors result,\r\n\t\t\tModelAndView mav) {\r\n\t\tif (result.hasErrors()) {\r\n\t\t\treturn mav;\r\n\t\t}\r\n\t\trepository.saveAndFlush(music);\r\n\t\treturn new ModelAndView(&quot;redirect:\/&quot;);\r\n\t}\r\n<\/pre>\n\n<div style=\"font-size: 0px; height: 0px; line-height: 0px; margin: 0; padding: 0; clear: both;\"><\/div>","protected":false},"excerpt":{"rendered":"<p>\u30d7\u30ec\u30a4\u30ea\u30b9\u30c8\u3092\u767b\u9332\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b \u30ea\u30dd\u30b8\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b\u3002 PlayListRepository.java \u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\u304c\u3001GET\u3068POST\u30e1\u30bd\u30c3\u30c9\u3092\u53d7\u3051\u53d6\u308b\u3088\u3046\u306b\u4fee\u6b63\u3059\u308b\u3002 HTML\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u3092\u4fee\u6b63\u3059\u308b\u3002 PlayL &hellip; <a href=\"https:\/\/2019se3.satoshis.jp\/?p=225\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;7\u67085\u65e5&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/225"}],"collection":[{"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=225"}],"version-history":[{"count":9,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/225\/revisions"}],"predecessor-version":[{"id":234,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=\/wp\/v2\/posts\/225\/revisions\/234"}],"wp:attachment":[{"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=225"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=225"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2019se3.satoshis.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=225"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}