{"id":1104,"date":"2025-02-17T12:15:36","date_gmt":"2025-02-17T03:15:36","guid":{"rendered":"https:\/\/route-zero.com\/recruit\/route\/1104\/"},"modified":"2025-03-25T10:56:07","modified_gmt":"2025-03-25T01:56:07","slug":"1104","status":"publish","type":"route","link":"https:\/\/route-zero.com\/recruit\/route\/1104\/","title":{"rendered":"Spring Boot\u306e\u3088\u304f\u4f7f\u308f\u308c\u308b\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3068\u306f\uff1f\u521d\u5fc3\u8005\u5fc5\u898b\u306e\u89e3\u8aac\u3068\u6d3b\u7528\u6cd5"},"content":{"rendered":"<div>\n<div id=\"js-contents\" class=\"p-tableOfContents\">\n<p class=\"p-tableOfContents__title\">\u76ee\u6b21<\/p>\n<ul>\n<li class=\"p-tableOfContents__links\">\n      <a href=\"#sec-intro\" class=\"js-link\">\u306f\u3058\u3081\u306b<\/a>\n    <\/li>\n<li class=\"p-tableOfContents__links\">\n      <a href=\"#sec-annotation\" class=\"js-link\">1. \u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3068\u306f\uff1f<\/a>\n    <\/li>\n<li class=\"p-tableOfContents__links\">\n      <a href=\"#sec-annotations\" class=\"js-link\">2. Spring Boot\u3067\u3088\u304f\u4f7f\u308f\u308c\u308b\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3<\/a><\/p>\n<ul>\n<li><a href=\"#sec-springbootapplication\" class=\"js-link\">2.1. @SpringBootApplication<\/a><\/li>\n<li><a href=\"#sec-restcontroller\" class=\"js-link\">2.2. @RestController<\/a><\/li>\n<li><a href=\"#sec-requestmapping\" class=\"js-link\">2.3. @RequestMapping \/ @GetMapping \/ @PostMapping<\/a><\/li>\n<li><a href=\"#sec-autowired\" class=\"js-link\">2.4. @Autowired<\/a><\/li>\n<li><a href=\"#sec-value\" class=\"js-link\">2.5. @Value<\/a><\/li>\n<li><a href=\"#sec-entity\" class=\"js-link\">2.6. @Entity \/ @Table<\/a><\/li>\n<\/ul>\n<\/li>\n<li class=\"p-tableOfContents__links\">\n      <a href=\"#sec-what-to-learn\" class=\"js-link\">3. \u3069\u308c\u3092\u899a\u3048\u308c\u3070\u3044\u3044\u304b\uff1f<\/a>\n    <\/li>\n<li class=\"p-tableOfContents__links\">\n      <a href=\"#sec-summary\" class=\"js-link\">4. \u307e\u3068\u3081<\/a>\n    <\/li>\n<\/ul>\n<\/div>\n<h3 id=\"sec-intro\">\u306f\u3058\u3081\u306b<\/h3>\n<p>Spring Boot\u306f\u3001Java\u958b\u767a\u8005\u306b\u3068\u3063\u3066\u975e\u5e38\u306b\u4fbf\u5229\u306a\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3067\u3059\u3002\u305d\u306e\u7406\u7531\u306e\u4e00\u3064\u304c\u3001\u958b\u767a\u3092\u7c21\u7d20\u5316\u3059\u308b\u305f\u3081\u306e\u3055\u307e\u3056\u307e\u306a\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u70b9\u3067\u3059\u3002\u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001Spring Boot\u3067\u3088\u304f\u4f7f\u308f\u308c\u308b\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u3001\u305d\u308c\u3089\u306e\u4f7f\u3044\u65b9\u3084\u3001\u3069\u308c\u3092\u899a\u3048\u308b\u3079\u304d\u304b\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h3 id=\"sec-annotation\">1. \u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3068\u306f\uff1f<\/h3>\n<p>\u307e\u305a\u521d\u3081\u306b\u3001\u300c\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3068\u306f\u4f55\u304b\u300d\u306b\u3064\u3044\u3066\u7c21\u5358\u306b\u304a\u3055\u3089\u3044\u3057\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<strong>\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3<\/strong>\u306f\u3001Java\u306e\u30b3\u30fc\u30c9\u5185\u306b\u30e1\u30bf\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306e\u4ed5\u7d44\u307f\u3067\u3059\u3002\u3053\u308c\u306b\u3088\u3063\u3066\u3001\u30b3\u30fc\u30c9\u306e\u6319\u52d5\u3092\u52d5\u7684\u306b\u5909\u66f4\u3057\u305f\u308a\u3001\u7279\u5b9a\u306e\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u969b\u306e\u30d2\u30f3\u30c8\u3092\u4e0e\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u65e5\u5e38\u751f\u6d3b\u3067\u3044\u3046\u3068\u3053\u308d\u306e\u300c\u6307\u793a\u300d\u3084\u300c\u30de\u30fc\u30af\u300d\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u30ec\u30b9\u30c8\u30e9\u30f3\u3067\u300c\u304a\u52e7\u3081\u30e1\u30cb\u30e5\u30fc\u300d\u3084\u300c\u672c\u65e5\u306e\u7279\u5225\u6599\u7406\u300d\u3068\u66f8\u304b\u308c\u305f\u770b\u677f\u3092\u898b\u304b\u3051\u305f\u3068\u304d\u3001\u305d\u308c\u3089\u306e\u30e1\u30cb\u30e5\u30fc\u304c\u7279\u5225\u3067\u3042\u308b\u3053\u3068\u304c\u4f1d\u308f\u308a\u307e\u3059\u3088\u306d\u3002\u3053\u308c\u3068\u540c\u3058\u3088\u3046\u306b\u3001\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u30b3\u30fc\u30c9\u306b\u300c\u3053\u306e\u90e8\u5206\u304c\u7279\u5225\u3067\u3001\u91cd\u8981\u3067\u3059\u3088\u300d\u3068\u4f1d\u3048\u308b\u5f79\u5272\u3092\u679c\u305f\u3057\u307e\u3059\u3002<\/p>\n<h3 id=\"sec-annotations\">2. Spring Boot\u3067\u3088\u304f\u4f7f\u308f\u308c\u308b\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3<\/h3>\n<p>Spring Boot\u3092\u4f7f\u3046\u969b\u306b\u983b\u7e41\u306b\u767b\u5834\u3059\u308b\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u3044\u304f\u3064\u304b\u7d39\u4ecb\u3057\u307e\u3059\u3002\u3053\u308c\u3089\u306f\u3001\u958b\u767a\u306b\u304a\u3044\u3066\u975e\u5e38\u306b\u91cd\u8981\u3067\u3042\u308a\u3001\u899a\u3048\u3066\u304a\u304f\u3068\u5b9f\u969b\u306e\u958b\u767a\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002<\/p>\n<p id=\"sec-springbootapplication\">2.1. @SpringBootApplication<\/p>\n<p>\u6700\u521d\u306b\u899a\u3048\u3066\u304a\u304f\u3079\u304d\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u3001@SpringBootApplication\u3067\u3059\u3002\u3053\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u3001Spring Boot\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u306b\u4ed8\u3051\u308b\u3082\u306e\u3067\u3059\u3002\u901a\u5e38\u3001\u3053\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30e1\u30a4\u30f3\u30af\u30e9\u30b9\u306b\u4ed8\u3051\u307e\u3059\u3002<\/p>\n<pre><code><span>@SpringBootApplication<\/span>\r\n<span>public<\/span> <span><span>class<\/span> <span>Application<\/span> <\/span>{\r\n    <span><span>public<\/span> <span>static<\/span> <span>void<\/span> <span>main<\/span><span>(String[] args)<\/span> <\/span>{\r\n        SpringApplication.run(Application.class, args);\r\n    }\r\n}<\/code><\/pre>\n<p>@SpringBootApplication\u306f\u3001\u5b9f\u306f\u4ee5\u4e0b\u306e3\u3064\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u307e\u3068\u3081\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n<ul>\n<li>\n<p>@EnableAutoConfiguration<\/p>\n<\/li>\n<li>\n<p>@ComponentScan<\/p>\n<\/li>\n<li>\n<p>@Configuration<\/p>\n<\/li>\n<\/ul>\n<p>\u3053\u308c\u3089\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001Spring Boot\u306e\u8a2d\u5b9a\u304c\u81ea\u52d5\u3067\u884c\u308f\u308c\u3001\u7279\u5225\u306a\u8a2d\u5b9a\u3092\u52a0\u3048\u306a\u304f\u3066\u3082\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u7c21\u5358\u306b\u5b9f\u884c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u65e5\u5e38\u751f\u6d3b\u306b\u4f8b\u3048\u308b\u3068\u3001\u5bb6\u306e\u300c\u7384\u95a2\u300d\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002\u5bb6\u306b\u5165\u308b\u305f\u3081\u306e\u552f\u4e00\u306e\u5165\u53e3\u3067\u3042\u308a\u3001\u6700\u521d\u306b\u8a2a\u308c\u308b\u5834\u6240\u3067\u3059\u3002@SpringBootApplication\u306f\u3001\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u300c\u5165\u308a\u53e3\u300d\u3092\u793a\u3057\u3066\u3044\u308b\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3060\u3068\u8003\u3048\u308b\u3068\u308f\u304b\u308a\u3084\u3059\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p id=\"sec-restcontroller\">2.2. @RestController<\/p>\n<p>Spring Boot\u3067Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3092\u4f5c\u6210\u3059\u308b\u5834\u5408\u3001@RestController\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u304c\u3088\u304f\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u3053\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u3001HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u4ed8\u3051\u308b\u30af\u30e9\u30b9\u3092\u5b9a\u7fa9\u3059\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002@Controller\u3068\u306e\u9055\u3044\u306f\u3001@RestController\u304c\u81ea\u52d5\u7684\u306b\u30ec\u30b9\u30dd\u30f3\u30b9\u3092JSON\u5f62\u5f0f\u3067\u8fd4\u3059\u70b9\u3067\u3059\u3002<\/p>\n<pre><code><span>@RestController<\/span>\r\n<span>public<\/span> <span><span>class<\/span> <span>HelloController<\/span> <\/span>{\r\n    <span>@GetMapping<\/span>(<span>\"\/hello\"<\/span>)\r\n    <span><span>public<\/span> String <span>sayHello<\/span><span>()<\/span> <\/span>{\r\n        <span>return<\/span> <span>\"Hello, World!\"<\/span>;\r\n    }\r\n}<\/code><\/pre>\n<p>\u65e5\u5e38\u751f\u6d3b\u306b\u4f8b\u3048\u308b\u3068\u3001@RestController\u306f\u300c\u30ab\u30d5\u30a7\u306e\u30b9\u30bf\u30c3\u30d5\u300d\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002\u304a\u5ba2\u3055\u3093\u304c\u6ce8\u6587\u3092\u3059\u308b\uff08\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u308b\uff09\u3068\u3001\u30b9\u30bf\u30c3\u30d5\uff08@RestController\uff09\u304c\u305d\u306e\u6ce8\u6587\u3092\u53d7\u3051\u53d6\u3063\u3066\u3001\u63d0\u4f9b\u3059\u308b\u3082\u306e\uff08\u30ec\u30b9\u30dd\u30f3\u30b9\uff09\u3092\u8fd4\u3057\u3066\u304f\u308c\u307e\u3059\u3002\u30b9\u30bf\u30c3\u30d5\u304c\u76f4\u63a5\u6ce8\u6587\u3092\u53d7\u3051\u3001\u7b54\u3048\u3066\u304f\u308c\u308b\u3068\u3044\u3046\u610f\u5473\u3067\u3001Web\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5bfe\u3057\u3066\u76f4\u63a5\u7684\u306b\u5fdc\u7b54\u3059\u308b\u5f79\u5272\u3092\u679c\u305f\u3057\u307e\u3059\u3002<\/p>\n<p id=\"sec-requestmapping\">2.3. @RequestMapping \/ @GetMapping \/ @PostMapping<\/p>\n<p>\u3053\u308c\u3089\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u3001HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u53d7\u3051\u53d6\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002@RequestMapping\u306f\u6700\u3082\u6c4e\u7528\u7684\u306a\u65b9\u6cd5\u3067\u3059\u304c\u3001@GetMapping\u3084@PostMapping\u306a\u3069\u306fHTTP\u30e1\u30bd\u30c3\u30c9\u306b\u7279\u5316\u3057\u305f\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002\u7279\u5b9a\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u30de\u30c3\u30d4\u30f3\u30b0\u3059\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre><code><span>@RequestMapping<\/span>(<span>\"\/greet\"<\/span>)\r\n<span>public<\/span> <span>String<\/span> greet() {\r\n    <span>return<\/span> <span>\"Hello!\"<\/span>;\r\n}\r\n\r\n<span>@GetMapping<\/span>(<span>\"\/hello\"<\/span>)\r\n<span>public<\/span> <span>String<\/span> sayHello() {\r\n    <span>return<\/span> <span>\"Hello, GET request!\"<\/span>;\r\n}\r\n\r\n<span>@PostMapping<\/span>(<span>\"\/submit\"<\/span>)\r\n<span>public<\/span> <span>String<\/span> submitData(<span>@RequestBody<\/span> <span>String<\/span> data) {\r\n    <span>return<\/span> <span>\"Data submitted: \"<\/span> + data;\r\n}<\/code><\/pre>\n<p>\u3053\u308c\u3092\u65e5\u5e38\u751f\u6d3b\u306b\u7f6e\u304d\u63db\u3048\u308b\u3068\u3001@RequestMapping\u306f\u300c\u30ec\u30b9\u30c8\u30e9\u30f3\u306e\u30e1\u30cb\u30e5\u30fc\u8868\u300d\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002\u304a\u5ba2\u3055\u3093\uff08\u30e6\u30fc\u30b6\u30fc\uff09\u304c\u30e1\u30cb\u30e5\u30fc\u3092\u898b\u3066\u6ce8\u6587\u3092\u6c7a\u3081\u308b\uff08\u30ea\u30af\u30a8\u30b9\u30c8\uff09\u969b\u306b\u3001\u30b9\u30bf\u30c3\u30d5\uff08\u30b3\u30f3\u30c8\u30ed\u30fc\u30e9\uff09\u304c\u305d\u308c\u306b\u5fdc\u3058\u305f\u6599\u7406\uff08\u30ec\u30b9\u30dd\u30f3\u30b9\uff09\u3092\u63d0\u4f9b\u3059\u308b\u305f\u3081\u306e\u5bfe\u5fdc\u304c\u884c\u308f\u308c\u307e\u3059\u3002@GetMapping\u306f\u300c\u304a\u5e97\u306e\u770b\u677f\u30e1\u30cb\u30e5\u30fc\u300d\u3001@PostMapping\u306f\u300c\u65e5\u66ff\u308f\u308a\u30e1\u30cb\u30e5\u30fc\u300d\u306e\u3088\u3046\u306b\u3001\u7279\u5b9a\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5bfe\u5fdc\u3059\u308b\u65b9\u6cd5\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p id=\"sec-autowired\">2.4. @Autowired<\/p>\n<p>\u3053\u3053\u3067\u3001@Autowired\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\u3053\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u3001Spring\u304c\u4ed6\u306e\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u300c\u81ea\u52d5\u7684\u306b\u6ce8\u5165\u3059\u308b\u300d\u305f\u3081\u306b\u4f7f\u7528\u3055\u308c\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001\u3042\u306a\u305f\u304c\u30ec\u30b9\u30c8\u30e9\u30f3\u3067\u6599\u7406\u3092\u983c\u3093\u3060\u3068\u3057\u307e\u3057\u3087\u3046\u3002\u305d\u306e\u6642\u3001\u30b9\u30bf\u30c3\u30d5\u304c\u300c\u6599\u7406\u3092\u6301\u3063\u3066\u304d\u3066\u304f\u308c\u308b\u300d\u3068\u3044\u3046\u5834\u9762\u3092\u60f3\u50cf\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u3053\u306e\u5834\u5408\u3001\u6599\u7406\u304c\u300c\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u300d\u3067\u3001\u30b9\u30bf\u30c3\u30d5\u304c\u300cSpring Framework\u300d\u3001\u305d\u3057\u3066\u3042\u306a\u305f\uff08\u30e6\u30fc\u30b6\u30fc\uff09\u304c\u6ce8\u6587\u8005\u3067\u3059\u3002<\/p>\n<p>\u5177\u4f53\u7684\u306a\u30b3\u30fc\u30c9\u4f8b\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code><span>@Component<\/span>\r\n<span>public<\/span> <span><span>class<\/span> <span>GreetingService<\/span> <\/span>{\r\n    <span><span>public<\/span> String <span>greet<\/span><span>()<\/span> <\/span>{\r\n        <span>return<\/span> <span>\"Hello, Spring Boot!\"<\/span>;\r\n    }\r\n}\r\n\r\n<span>@RestController<\/span>\r\n<span>public<\/span> <span><span>class<\/span> <span>HelloController<\/span> <\/span>{\r\n    <span>@Autowired<\/span>\r\n    <span>private<\/span> GreetingService greetingService;\r\n\r\n    <span>@GetMapping<\/span>(<span>\"\/greet\"<\/span>)\r\n    <span><span>public<\/span> String <span>greet<\/span><span>()<\/span> <\/span>{\r\n        <span>return<\/span> greetingService.greet();\r\n    }\r\n}<\/code><\/pre>\n<p>\u3053\u3053\u3067\u3001@Autowired\u304c\u4f7f\u308f\u308c\u3066\u3044\u308b\u306e\u306f\u3001GreetingService\u3068\u3044\u3046\u300c\u6599\u7406\u300d\u3092HelloController\u3068\u3044\u3046\u300c\u30b9\u30bf\u30c3\u30d5\u300d\u304c\u4f7f\u3048\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u308b\u90e8\u5206\u3067\u3059\u3002\u30b9\u30bf\u30c3\u30d5\uff08HelloController\uff09\u306fGreetingService\u3092\u4f9d\u983c\uff08\u6ce8\u5165\uff09\u3059\u308b\u3053\u3068\u306a\u304f\u3001\u81ea\u52d5\u7684\u306b\u6599\u7406\uff08\u30b5\u30fc\u30d3\u30b9\u30e1\u30bd\u30c3\u30c9\uff09\u3092\u53d7\u3051\u53d6\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3064\u307e\u308a\u3001@Autowired\u3092\u4f7f\u3046\u3053\u3068\u3067\u3001Spring\u304cGreetingService\u3092\u81ea\u52d5\u7684\u306b\u6e96\u5099\u3057\u3066\u304f\u308c\u3001HelloController\u306f\u305d\u306e\u6e96\u5099\u3055\u308c\u305f\u30b5\u30fc\u30d3\u30b9\u3092\u4f7f\u3063\u3066\u51e6\u7406\u3092\u5b9f\u884c\u3067\u304d\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n<p id=\"sec-value\">2.5. @Value<\/p>\n<p>@Value\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u3001\u5916\u90e8\u306e\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u5024\u3092\u53d6\u5f97\u3059\u308b\u969b\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001application.properties\u3084application.yml\u30d5\u30a1\u30a4\u30eb\u306b\u5b9a\u7fa9\u3055\u308c\u305f\u30d7\u30ed\u30d1\u30c6\u30a3\u5024\u3092\u6ce8\u5165\u3059\u308b\u969b\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre><code><span>@RestController<\/span>\r\n<span>public<\/span> <span><span>class<\/span> <span>ConfigController<\/span> <\/span>{\r\n    <span>@Value<\/span>(<span>\"${myapp.name}\"<\/span>)\r\n    <span>private<\/span> String appName;\r\n\r\n    <span>@GetMapping<\/span>(<span>\"\/config\"<\/span>)\r\n    <span><span>public<\/span> String <span>getConfig<\/span><span>()<\/span> <\/span>{\r\n        <span>return<\/span> <span>\"App Name: \"<\/span> + appName;\r\n    }\r\n}<\/code><\/pre>\n<p>\u3053\u308c\u306f\u300c\u30ec\u30b9\u30c8\u30e9\u30f3\u306e\u6ce8\u6587\u66f8\u300d\u306b\u4f8b\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u6ce8\u6587\u66f8\u306b\u306f\u3001\u4f55\u3092\u6ce8\u6587\u3059\u308b\u304b\uff08myapp.name\u306e\u5024\uff09\u304c\u66f8\u304b\u308c\u3066\u3044\u307e\u3059\u3002\u30b9\u30bf\u30c3\u30d5\uff08Spring\uff09\u304c\u305d\u306e\u6ce8\u6587\u66f8\u3092\u898b\u3066\u3001\u5fc5\u8981\u306a\u60c5\u5831\uff08appName\uff09\u3092\u63d0\u4f9b\u3057\u3066\u304f\u308c\u308b\u3001\u3068\u3044\u3046\u5f79\u5272\u3067\u3059\u3002<\/p>\n<p id=\"sec-entity\">2.6. @Entity \/ @Table<\/p>\n<p>Spring Boot\u3067JPA\uff08Java Persistence API\uff09\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u3001@Entity\u3068@Table\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u304c\u3088\u304f\u4f7f\u308f\u308c\u307e\u3059\u3002@Entity\u306f\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u30de\u30c3\u30d4\u30f3\u30b0\u3059\u308b\u305f\u3081\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<\/p>\n<pre><code><span>@Entity<\/span>\r\n<span>@Table<\/span>(name = <span>\"users\"<\/span>)\r\n<span>public<\/span> <span>class<\/span> User {\r\n    <span>@Id<\/span>\r\n    <span>@GeneratedValue<\/span>(strategy = GenerationType.IDENTITY)\r\n    <span>private<\/span> Long id;\r\n    <span>private<\/span> <span>String<\/span> username;\r\n    <span>private<\/span> <span>String<\/span> password;\r\n\r\n    <span>\/\/ \u30b2\u30c3\u30bf\u30fc\u3068\u30bb\u30c3\u30bf\u30fc<\/span>\r\n}<\/code><\/pre>\n<p>\u3053\u308c\u3092\u65e5\u5e38\u751f\u6d3b\u306b\u4f8b\u3048\u308b\u3068\u3001\u300c\u30ec\u30b9\u30c8\u30e9\u30f3\u306e\u30e1\u30cb\u30e5\u30fc\u30ea\u30b9\u30c8\u300d\u306e\u3088\u3046\u306a\u3082\u306e\u3067\u3059\u3002@Entity\u306f\u305d\u306e\u30e1\u30cb\u30e5\u30fc\u9805\u76ee\uff08\u30c6\u30fc\u30d6\u30eb\u306e\u884c\uff09\u3092\u6307\u3057\u3001@Table\u306f\u305d\u306e\u30e1\u30cb\u30e5\u30fc\u30ea\u30b9\u30c8\uff08\u30c6\u30fc\u30d6\u30eb\u81ea\u4f53\uff09\u306b\u76f8\u5f53\u3057\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u3044\u3046\u300c\u30e1\u30cb\u30e5\u30fc\u30ea\u30b9\u30c8\u300d\u306e\u4e2d\u3067\u3001\u7279\u5b9a\u306e\u6599\u7406\uff08\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\uff09\u304c\u3069\u3053\u306b\u3042\u308b\u304b\u3092\u793a\u3057\u3066\u3044\u308b\u308f\u3051\u3067\u3059\u3002<\/p>\n<h3 id=\"sec-what-to-learn\">3. \u3069\u308c\u3092\u899a\u3048\u308c\u3070\u3044\u3044\u304b\uff1f<\/h3>\n<p>Spring Boot\u3092\u59cb\u3081\u305f\u3070\u304b\u308a\u306e\u65b9\u306b\u3068\u3063\u3066\u3001\u6700\u3082\u91cd\u8981\u306a\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u7d5e\u308a\u8fbc\u3080\u3068\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<ol>\n<li>\n<p><strong>@SpringBootApplication<\/strong> \u2013 \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\u3067\u5fc5\u9808<\/p>\n<\/li>\n<li>\n<p><strong>@RestController<\/strong> \u2013 REST API\u306e\u4f5c\u6210\u306b\u5fc5\u9808<\/p>\n<\/li>\n<li>\n<p><strong>@Autowired<\/strong> \u2013 \u4f9d\u5b58\u6027\u6ce8\u5165\u3067\u91cd\u8981<\/p>\n<\/li>\n<li>\n<p><strong>@Value<\/strong> \u2013 \u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u304b\u3089\u306e\u5024\u306e\u53d6\u5f97\u3067\u5fc5\u9808<\/p>\n<\/li>\n<\/ol>\n<p>\u3053\u308c\u3089\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306f\u3001Spring Boot\u3092\u4f7f\u3063\u305fWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u3067\u983b\u7e41\u306b\u767b\u5834\u3057\u307e\u3059\u306e\u3067\u3001\u3057\u3063\u304b\u308a\u899a\u3048\u3066\u304a\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3 id=\"sec-summary\">4. \u307e\u3068\u3081<\/h3>\n<p>Spring Boot\u3067\u3088\u304f\u4f7f\u308f\u308c\u308b\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066\u89e3\u8aac\u3057\u307e\u3057\u305f\u3002\u3053\u308c\u3089\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u958b\u767a\u304c\u52b9\u7387\u5316\u3055\u308c\u3001\u3088\u308a\u30b7\u30f3\u30d7\u30eb\u3067\u30e1\u30f3\u30c6\u30ca\u30f3\u30b9\u6027\u306e\u9ad8\u3044\u30b3\u30fc\u30c9\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u6b21\u306e\u30b9\u30c6\u30c3\u30d7\u3068\u3057\u3066\u3001\u3055\u3089\u306bSpring Boot\u306e\u6df1\u3044\u90e8\u5206\u3084\u3001\u5b9f\u969b\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u3069\u306e\u3088\u3046\u306b\u3053\u308c\u3089\u306e\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u3044\u304f\u304b\u3092\u5b66\u3093\u3067\u3044\u304f\u3068\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<hr>\n<h3>\u3010\u5916\u90e8\u30ea\u30f3\u30af\u3011<\/h3>\n<p><a href=\"https:\/\/spring.io\/guides\/gs\/serving-web-content\/\">Spring Framework\u516c\u5f0f\u30ac\u30a4\u30c9 \u2013 Spring MVC<\/a><\/p>\n<h3>\u3010\u5185\u90e8\u30ea\u30f3\u30af\u3011<\/h3>\n<p><a href=\"https:\/\/route-zero.com\/recruit\/route\/1088\/\">Spring Boot\u30a2\u30d7\u30ea\u958b\u767a\u3067\u983b\u767a\u3059\u308bWhitelabel Error Page\uff5cThymeleaf\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u30a8\u30e9\u30fc\u3068\u5bfe\u7b56\u307e\u3068\u3081<\/a><\/p>\n<p><a href=\"https:\/\/route-zero.com\/recruit\/route\/936\/\">Docker + Spring Boot \u3067\u624b\u8efd\u306b\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\u3057\u3088\u3046\uff01<\/a><\/p>\n<p><a href=\"https:\/\/route-zero.com\/recruit\/route\/1100\/\">\u3010Spring Boot\u5b9f\u8df5\u30ac\u30a4\u30c9\u3011List\u578b\u30fbMap\u578b\u306e\u9055\u3044\u3068Bean\u30af\u30e9\u30b9\u306e\u57fa\u790e\uff06\u5fdc\u7528<\/a><\/p>\n<p><a href=\"https:\/\/route-zero.com\/recruit\/route\/922\/\">Java\u3068Spring Boot\u3067\u5b66\u3076Web\u30a2\u30d7\u30ea\u4f5c\u6210\u306e\u7b2c\u4e00\u6b69\uff5c\u521d\u5fc3\u8005\u5411\u3051\u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u30ac\u30a4\u30c9<\/a><\/p>\n<\/div>\n","protected":false},"featured_media":1105,"template":"","_links":{"self":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route\/1104"}],"collection":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route"}],"about":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/types\/route"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media\/1105"}],"wp:attachment":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media?parent=1104"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}