{"id":1882,"date":"2025-09-05T10:08:48","date_gmt":"2025-09-05T01:08:48","guid":{"rendered":"https:\/\/route-zero.com\/recruit\/?post_type=route&#038;p=1882"},"modified":"2026-02-05T10:09:01","modified_gmt":"2026-02-05T01:09:01","slug":"%e3%81%be%e3%81%a0entity%e3%82%92api%e3%81%a7%e7%9b%b4%e8%bf%94%e3%81%97%ef%bc%9fdto%e3%81%a7%e9%98%b2%e3%81%903%e3%81%a4%e3%81%ae%e6%b7%b1%e5%88%bb%e3%83%aa%e3%82%b9%e3%82%af","status":"publish","type":"route","link":"https:\/\/route-zero.com\/recruit\/route\/1882\/","title":{"rendered":"\u307e\u3060Entity\u3092API\u3067\u76f4\u8fd4\u3057\uff1fDTO\u3067\u9632\u30503\u3064\u306e\u6df1\u523b\u30ea\u30b9\u30af"},"content":{"rendered":"<div>\n<h1>Entity\u306eAPI\u76f4\u8fd4\u3057\u306fNG\uff1fDTO\u3068Model\u306e\u9055\u3044\u3092\u7406\u89e3\u3057\u5b89\u5168\u306aJava\u30b3\u30fc\u30c9\u3078<\/h1>\n<p>\u300cDB\u304b\u3089\u53d6\u5f97\u3057\u305f<strong>UserEntity<\/strong>\u3092\u3001\u3053\u306e<strong>UserDTO<\/strong>\u306b\u8a70\u3081\u3066\u8fd4\u3057\u3066\u2026\u300d<\/p>\n<p>\n    \u5148\u8f29\u306e\u305d\u306e\u4e00\u8a00\u306b\u3001\u6238\u60d1\u3063\u305f\u7d4c\u9a13\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f<br \/>\n    \u306a\u305c\u4f3c\u305f\u3088\u3046\u306a\u30af\u30e9\u30b9\u304c\u3044\u304f\u3064\u3082\u5b58\u5728\u3059\u308b\u306e\u304b\u3001\u306a\u305c\u540c\u3058\u30c7\u30fc\u30bf\u3092\u308f\u3056\u308f\u3056\u624b\u4f5c\u696d\u3067\u79fb\u3057\u66ff\u3048\u308b\u306e\u304b\u3002\u6b63\u76f4\u3001\u9762\u5012\u3067\u975e\u52b9\u7387\u3060\u3068\u611f\u3058\u3066\u3057\u307e\u3044\u307e\u3059\u3088\u306d\u3002\u305d\u306e\u6c17\u6301\u3061\u3001\u3088\u304f\u308f\u304b\u308a\u307e\u3059\u3002\n  <\/p>\n<p>\u3057\u304b\u3057\u3001\u305d\u306e\u300c\u9762\u5012\u306a\u4f5c\u696d\u300d\u306b\u306f\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u5b89\u5168\u6027\u3068\u4fdd\u5b88\u6027\u3092\u5b88\u308b\u305f\u3081\u306e\u91cd\u8981\u306a\u8a2d\u8a08\u601d\u60f3\u304c\u96a0\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3059\u3002<\/p>\n<p>\n    \u3053\u306e\u8a18\u4e8b\u3067\u306f\u3001\u958b\u767a\u73fe\u5834\u3067\u6df7\u4e71\u3057\u304c\u3061\u306a <strong>DTO<\/strong>\u30fb<strong>Entity<\/strong>\u30fb<strong>Model<\/strong>\u306e\u5f79\u5272\u306e\u9055\u3044\u3092\u3001\u56f3\u89e3\u3082\u4ea4\u3048\u306a\u304c\u30895\u5206\u3067\u7406\u89e3\u3067\u304d\u308b\u3088\u3046\u89e3\u8aac\u3057\u307e\u3059\u3002<br \/>\n    \u3055\u3089\u306b\u3001\u300c\u306a\u305c<strong>Entity<\/strong>\u3092\u305d\u306e\u307e\u307eAPI\u3067\u8fd4\u3057\u3066\u306f\u3044\u3051\u306a\u3044\u306e\u304b\uff1f\u300d\u3068\u3044\u3046\u6839\u672c\u7684\u306a\u7591\u554f\u306b\u3001\u5177\u4f53\u7684\u306aNG\u30b3\u30fc\u30c9\u3092\u4f8b\u306b\u6319\u3052\u3066\u304a\u7b54\u3048\u3057\u307e\u3059\u3002\n  <\/p>\n<p>\u8aad\u307f\u7d42\u3048\u308b\u9803\u306b\u306f\u3001\u9762\u5012\u3060\u3068\u611f\u3058\u3066\u3044\u305f\u5909\u63db\u4f5c\u696d\u306e\u610f\u56f3\u3092\u6df1\u304f\u7406\u89e3\u3057\u3001\u81ea\u4fe1\u3092\u6301\u3063\u3066\u65e5\u3005\u306e\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u306b\u53d6\u308a\u7d44\u3081\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<hr \/>\n<h2>DTO\u30fbEntity\u30fbModel\uff1a3\u3064\u306e\u5f79\u5272\u306e\u9055\u3044<\/h2>\n<p>\u307e\u305a\u7d50\u8ad6\u304b\u3089\u3002\u3053\u308c\u30893\u3064\u306e\u8a00\u8449\u304c\u793a\u3059\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u3001\u305d\u308c\u305e\u308c\u62c5\u3063\u3066\u3044\u308b\u300c\u5f79\u5272\u300d\u3068\u300c\u8cac\u4efb\u7bc4\u56f2\u300d\u304c\u660e\u78ba\u306b\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n<h3>1. Entity: DB\u3068\u5bfe\u8a71\u3059\u308b\u300c\u30b7\u30b9\u30c6\u30e0\u306e\u6838\u300d<\/h3>\n<p>\n    <strong>Entity<\/strong>\u306f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\uff08DB\uff09\u306e\u30c6\u30fc\u30d6\u30eb\u69cb\u9020\u3092\u30de\u30c3\u30d4\u30f3\u30b0\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002 <strong>JPA<\/strong> (Java Persistence API) \u3067\u306f<br \/>\n    <strong> @Entity<\/strong> \u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4ed8\u3051\u3066\u8868\u73fe\u3057\u307e\u3059\u3002\n  <\/p>\n<p>\u305d\u306e\u4e3b\u306a\u5f79\u5272\u306f\u3001DB\u3068\u306e\u30c7\u30fc\u30bf\u6c38\u7d9a\u5316\uff08\u4fdd\u5b58\u3001\u53d6\u5f97\u3001\u66f4\u65b0\u3001\u524a\u9664\uff09\u3092\u884c\u3046\u3053\u3068\u306b\u7279\u5316\u3057\u3066\u3044\u307e\u3059\u3002 \u300c\u30b7\u30b9\u30c6\u30e0\u306e\u5185\u90e8\u3001\u7279\u306b\u30c7\u30fc\u30bf\u5c64\u3067\u50cd\u304f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u300d\u3068\u6349\u3048\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><code>\/\/ \u4f8b: UserEntity.java\r\n @Entity @Table(name = \"users\")\r\npublic class UserEntity {\r\n    @Id\r\n    private Long id;\r\n    private String username;\r\n    private String password; \/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\u306e\u3088\u3046\u306a\u6a5f\u5bc6\u60c5\u5831\u3082\u542b\u3080\r\n    \/\/ ... getter\/setter\r\n}\r\n<\/code><\/pre>\n<h3>2. DTO: \u5916\u90e8\u3068\u901a\u4fe1\u3059\u308b\u305f\u3081\u306e\u300c\u30c7\u30fc\u30bf\u306e\u7bb1\u300d<\/h3>\n<p><strong>DTO<\/strong> (Data Transfer Object) \u306f\u3001\u305d\u306e\u540d\u306e\u901a\u308a\u3001\u30b7\u30b9\u30c6\u30e0\uff08\u30ec\u30a4\u30e4\u30fc\uff09\u9593\u3067\u30c7\u30fc\u30bf\u3092\u8ee2\u9001\u3059\u308b\u305f\u3081\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3059\u3002<\/p>\n<p>\n    \u7279\u306b\u3001API\u306e\u30ec\u30b9\u30dd\u30f3\u30b9\u3084\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u3088\u3046\u306b\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u300c\u5916\u90e8\u300d\u3068\u306e\u901a\u4fe1\u3067\u4f7f\u308f\u308c\u308b\u3053\u3068\u304c\u591a\u304f\u3001<strong>Entity<\/strong>\u304b\u3089\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u3060\u3051\u3092\u629c\u304d\u51fa\u3057\u3066\u683c\u7d0d\u3059\u308b\u305f\u3081\u306e\u300c\u5c02\u7528\u306e\u7bb1\u300d\u3068\u30a4\u30e1\u30fc\u30b8\u3059\u308b\u3068\u5206\u304b\u308a\u3084\u3059\u3044\u3067\u3057\u3087\u3046\u3002\n  <\/p>\n<pre><code>\/\/ \u4f8b: UserDto.java\r\npublic class UserDto {\r\n    private Long id;\r\n    private String username;\r\n    \/\/ password\u306f\u542b\u3081\u306a\u3044\r\n    \/\/ ... getter\/setter\r\n}\r\n<\/code><\/pre>\n<h3>3. Model: \u6587\u8108\u3067\u610f\u5473\u304c\u5909\u308f\u308b\u300c\u591a\u7fa9\u7684\u306a\u8a00\u8449\u300d<\/h3>\n<p><strong>Model<\/strong>\u306f\u3001\u6700\u3082\u6ce8\u610f\u304c\u5fc5\u8981\u306a\u8a00\u8449\u3067\u3059\u3002\u306a\u305c\u306a\u3089\u3001\u4f7f\u308f\u308c\u308b\u6587\u8108\u306b\u3088\u3063\u3066\u6307\u3059\u3082\u306e\u304c\u5168\u304f\u7570\u306a\u308b\u304b\u3089\u3067\u3059\u3002<\/p>\n<ul>\n<li>\n      <strong>MVC\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306e\u6587\u8108<\/strong>: <strong>Model<\/strong>\u306f\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u3084\u30c7\u30fc\u30bf\u3092\u6271\u3046\u5c64\u5168\u4f53\u3092\u6307\u3057\u307e\u3059\u3002\uff08MVC\u69cb\u6210\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1269\/\"\n        >MVC\u69cb\u6210\u3092\u7406\u89e3\u3059\u308c\u3070\u73fe\u5834\u3067\u8a70\u307e\u3089\u306a\u3044 | Spring Boot\u5b9f\u88c5\u30ac\u30a4\u30c9<\/a\n      >\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09\n    <\/li>\n<li><strong>\u5358\u306a\u308b\u30c7\u30fc\u30bf\u5165\u308c\u66ff\u3048\u306e\u6587\u8108<\/strong>: <strong>DTO<\/strong>\u3084<strong>Entity<\/strong>\u3092\u6307\u3057\u3066\u300c\u30e2\u30c7\u30eb\u300d\u3068\u547c\u3076\u4eba\u3082\u3044\u307e\u3059\u3002<\/li>\n<li><strong>\u30c9\u30e1\u30a4\u30f3\u99c6\u52d5\u8a2d\u8a08\uff08DDD\uff09\u306e\u6587\u8108<\/strong>: <strong>\u30c9\u30e1\u30a4\u30f3\u30e2\u30c7\u30eb<\/strong>\u3068\u3057\u3066\u3001\u3088\u308a\u8907\u96d1\u306a\u30d3\u30b8\u30cd\u30b9\u30eb\u30fc\u30eb\u3092\u5185\u5305\u3057\u305f\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u6307\u3057\u307e\u3059\u3002<\/li>\n<\/ul>\n<p>\u3053\u306e\u3088\u3046\u306b<strong>Model<\/strong>\u306f\u591a\u7fa9\u7684\u3067\u3059\u3002\u8ab0\u304b\u304c\u300c\u30e2\u30c7\u30eb\u300d\u3068\u8a00\u3063\u305f\u3068\u304d\u306f\u3001\u300c\u305d\u308c\u306f\u5177\u4f53\u7684\u306b\u3069\u306e\u5f79\u5272\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u6307\u3057\u3066\u3044\u307e\u3059\u304b\uff1f\u300d\u3068\u78ba\u8a8d\u3059\u308b\u7656\u3092\u3064\u3051\u308b\u3068\u3001\u8a8d\u8b58\u306e\u9f5f\u9f6c\u3092\u9632\u3052\u307e\u3059\u3002<\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aEntity\uff08\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3\uff09<\/strong><br \/>\n      \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u69cb\u9020\u3092\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u3067\u8868\u73fe\u3057\u305f\u3082\u306e\u3002\u4e3b\u306b\u30c7\u30fc\u30bf\u306e\u4fdd\u5b58\u3084\u8aad\u307f\u66f8\u304d\u3068\u3044\u3063\u305f\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3068\u306e\u76f4\u63a5\u7684\u306a\u3084\u308a\u53d6\u308a\u306b\u5229\u7528\u3055\u308c\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aDTO\uff08Data Transfer Object\uff09<\/strong><br \/>\n      \u30b7\u30b9\u30c6\u30e0\u306e\u7570\u306a\u308b\u90e8\u5206\uff08\u30ec\u30a4\u30e4\u30fc\uff09\u3084\u5916\u90e8\u30b7\u30b9\u30c6\u30e0\u3068\u306e\u9593\u3067\u3001\u30c7\u30fc\u30bf\u3092\u3084\u308a\u53d6\u308a\uff08\u8ee2\u9001\uff09\u3059\u308b\u305f\u3081\u306b\u4f7f\u308f\u308c\u308b\u5c02\u7528\u306e\u5165\u308c\u7269\u3002API\u306e\u5fdc\u7b54\u306a\u3069\u3067\u3001\u5fc5\u8981\u306a\u60c5\u5831\u3060\u3051\u3092\u8a70\u3081\u3066\u8fd4\u3059\u7528\u9014\u3067\u6d3b\u8e8d\u3059\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aModel\uff08\u30e2\u30c7\u30eb\uff09<\/strong><br \/>\n      \u4f7f\u308f\u308c\u308b\u6587\u8108\u306b\u3088\u3063\u3066\u610f\u5473\u304c\u5927\u304d\u304f\u5909\u308f\u308b\u8a00\u8449\u3002\u5358\u306a\u308b\u30c7\u30fc\u30bf\u3092\u683c\u7d0d\u3059\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u6307\u3059\u3053\u3068\u3082\u3042\u308c\u3070\u3001\u30d3\u30b8\u30cd\u30b9\u306e\u30eb\u30fc\u30eb\u3084\u51e6\u7406\u5168\u4f53\u3092\u6307\u3059\u3053\u3068\u3082\u3042\u308b\u305f\u3081\u3001\u78ba\u8a8d\u304c\u5fc5\u8981\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aJPA\uff08Java Persistence API\uff09<\/strong><br \/>\n      Java\u30d7\u30ed\u30b0\u30e9\u30e0\u304b\u3089\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3092\u7c21\u5358\u306b\u64cd\u4f5c\u3059\u308b\u305f\u3081\u306e\u300c\u6a19\u6e96\u7684\u306a\u30eb\u30fc\u30eb\uff08\u4ed5\u69d8\uff09\u300d\u3002\u3053\u306e\u30eb\u30fc\u30eb\u306b\u5f93\u3046\u3053\u3068\u3067\u3001SQL\u3092\u76f4\u63a5\u66f8\u304b\u305a\u306b\u30c7\u30fc\u30bf\u306e\u6c38\u7d9a\u5316\u304c\u53ef\u80fd\u306b\u306a\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30c7\u30fc\u30bf\u6c38\u7d9a\u5316<\/strong><br \/>\n      \u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u7d42\u4e86\u3057\u3066\u3082\u30c7\u30fc\u30bf\u304c\u6d88\u3048\u306a\u3044\u3088\u3046\u306b\u3001\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u3084\u30d5\u30a1\u30a4\u30eb\u306a\u3069\u306b\u4fdd\u5b58\u3059\u308b\u3053\u3068\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aMVC\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af<\/strong><br \/>\n      \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u8a2d\u8a08\u3092\u300cModel\uff08\u30c7\u30fc\u30bf\u30fb\u30ed\u30b8\u30c3\u30af\uff09\u300d\u300cView\uff08\u753b\u9762\uff09\u300d\u300cController\uff08\u5236\u5fa1\uff09\u300d\u306e3\u5f79\u306b\u5206\u3051\u3066\u958b\u767a\u3092\u9032\u3081\u308b\u305f\u3081\u306e\u67a0\u7d44\u307f\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30c9\u30e1\u30a4\u30f3\u99c6\u52d5\u8a2d\u8a08\uff08DDD\uff09<\/strong><br \/>\n      \u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u304c\u6271\u3046\u3079\u304d\u300c\u30d3\u30b8\u30cd\u30b9\u9818\u57df\uff08\u30c9\u30e1\u30a4\u30f3\uff09\u300d\u306e\u30eb\u30fc\u30eb\u3084\u77e5\u8b58\u3092\u4e2d\u5fc3\u306b\u636e\u3048\u3066\u8a2d\u8a08\u3092\u9032\u3081\u308b\u958b\u767a\u624b\u6cd5\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3067\u898b\u308bDTO\u3068Entity\u306e\u5f79\u5272<\/h2>\n<p>\n    \u3067\u306f\u3001<strong>Entity<\/strong>\u3068<strong>DTO<\/strong>\u306f\u30b7\u30b9\u30c6\u30e0\u306e\u3069\u3053\u3067\u3001\u3069\u306e\u3088\u3046\u306b\u9023\u643a\u3059\u308b\u306e\u3067\u3057\u3087\u3046\u304b\u3002 \u4e00\u822c\u7684\u306aWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\uff083\u5c64\u69cb\u9020\uff09\u306b\u304a\u3051\u308b\u30c7\u30fc\u30bf\u306e\u6d41\u308c\u3092\u898b\u3066\u307f\u307e\u3057\u3087\u3046\u3002\n  <\/p>\n<pre><code>[\u30af\u30e9\u30a4\u30a2\u30f3\u30c8] &lt;=&gt; [Controller (DTO)] &lt;=&gt; [Service (Entity\/DTO)] &lt;=&gt; [Repository (Entity)] &lt;=&gt; [DB]\r\n<\/code><\/pre>\n<ul>\n<li><strong>Controller\u5c64<\/strong>: \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092<strong>DTO<\/strong>\u3067\u53d7\u3051\u53d6\u308a\u3001\u30ec\u30b9\u30dd\u30f3\u30b9\u3092<strong>DTO<\/strong>\u3067\u8fd4\u3057\u307e\u3059\u3002\u5916\u90e8\u3068\u306e\u7a93\u53e3\u5f79\u3067\u3059\u3002<\/li>\n<li><strong>Service\u5c64<\/strong>: \u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u3092\u62c5\u5f53\u3057\u307e\u3059\u3002<strong>Entity<\/strong>\u3068<strong>DTO<\/strong>\u306e\u5909\u63db\u51e6\u7406\u306e\u4e3b\u6226\u5834\u306f\u3053\u3053\u3067\u3059\u3002<\/li>\n<li><strong>Repository\u5c64<\/strong>: <strong>Entity<\/strong>\u3092\u4f7f\u3063\u3066DB\u3068\u306e\u76f4\u63a5\u7684\u306a\u3084\u308a\u53d6\u308a\uff08CRUD\u64cd\u4f5c\uff09\u3092\u884c\u3044\u307e\u3059\u3002\u3053\u306e\u5c64\u304c<strong>DTO<\/strong>\u306b\u89e6\u308c\u308b\u3053\u3068\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/li>\n<\/ul>\n<p>\u5404\u5c64\u304c\u81ea\u8eab\u306e\u5f79\u5272\u306b\u6700\u9069\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3060\u3051\u3092\u6271\u3046\u3053\u3068\u3067\u3001\u95a2\u5fc3\u306e\u5206\u96e2\u304c\u5b9f\u73fe\u3055\u308c\u3001\u30af\u30ea\u30fc\u30f3\u306a\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u304c\u4fdd\u305f\u308c\u308b\u306e\u3067\u3059\u3002<\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3<\/strong><br \/>\n      \u30b7\u30b9\u30c6\u30e0\u5168\u4f53\u306e\u69cb\u9020\u3084\u8a2d\u8a08\u601d\u60f3\u306e\u3053\u3068\u3002\u3069\u306e\u3088\u3046\u306a\u90e8\u54c1\uff08\u30af\u30e9\u30b9\u3084\u30e2\u30b8\u30e5\u30fc\u30eb\uff09\u3067\u69cb\u6210\u3055\u308c\u3001\u305d\u308c\u3089\u304c\u3069\u3046\u9023\u643a\u3059\u308b\u306e\u304b\u3092\u793a\u3057\u305f\u300c\u8a2d\u8a08\u56f3\u300d\u306b\u3042\u305f\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u95a2\u5fc3\u306e\u5206\u96e2<\/strong><br \/>\n      \u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5404\u90e8\u5206\u304c\u3001\u305d\u308c\u305e\u308c\u81ea\u5206\u306e\u5f79\u5272\u306b\u3060\u3051\u96c6\u4e2d\u3067\u304d\u308b\u3088\u3046\u306b\u8a2d\u8a08\u3059\u308b\u3053\u3068\u3002\u300c<strong>\u8868\u793a<\/strong>\u300d\u300c<strong>\u51e6\u7406<\/strong>\u300d\u300c<strong>\u30c7\u30fc\u30bf\u4fdd\u5b58<\/strong>\u300d\u306a\u3069\u3092\u5206\u3051\u308b\u3053\u3068\u3067\u3001\u5909\u66f4\u306b\u5f37\u304f\u898b\u901a\u3057\u306e\u826f\u3044\u30b3\u30fc\u30c9\u306b\u306a\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aCRUD\u64cd\u4f5c<\/strong><br \/>\n      \u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u64cd\u4f5c\u306e\u57fa\u672c\u3067\u3042\u308b\u300c<strong>Create\uff08\u4f5c\u6210\uff09<\/strong>\u300d\u300c<strong>Read\uff08\u8aad\u307f\u53d6\u308a\uff09<\/strong>\u300d\u300c<strong>Update\uff08\u66f4\u65b0\uff09<\/strong>\u300d\u300c<strong>Delete\uff08\u524a\u9664\uff09<\/strong>\u300d\u306e\u982d\u6587\u5b57\u3092\u53d6\u3063\u305f\u8a00\u8449\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>Entity\u76f4\u8fd4\u3057\u304c\u62db\u304f3\u3064\u306e\u6df1\u523b\u306a\u30ea\u30b9\u30af<\/h2>\n<p>\u300c\u3067\u3082\u3001\u306a\u305c\u308f\u3056\u308f\u3056\u5909\u63db\u304c\u5fc5\u8981\u306a\u306e\uff1f<strong>Entity<\/strong>\u3092\u305d\u306e\u307e\u307e\u8fd4\u305b\u3070\u697d\u3058\u3083\u306a\u3044\u304b\u300d\u3068\u3044\u3046\u7591\u554f\u306b\u7b54\u3048\u307e\u3059\u3002 \u305d\u306e\u884c\u70ba\u306b\u306f\u3001\u4e3b\u306b3\u3064\u306e\u6df1\u523b\u306a\u30ea\u30b9\u30af\u304c\u6f5c\u3093\u3067\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30ea\u30b9\u30af\u2460\uff1a\u610f\u56f3\u3057\u306a\u3044\u60c5\u5831\u6f0f\u6d29\u3010NG\u30b3\u30fc\u30c9\u3067\u898b\u308b\u3011<\/h3>\n<p>\n    \u6700\u3082\u5371\u967a\u306a\u306e\u304c\u3001\u610f\u56f3\u3057\u306a\u3044\u60c5\u5831\u306e\u6f0f\u6d29\u3067\u3059\u3002<br \/>\n    <strong>Entity<\/strong>\u306fDB\u30c6\u30fc\u30d6\u30eb\u30681\u5bfe1\u306b\u5bfe\u5fdc\u3059\u308b\u305f\u3081\u3001\u30d1\u30b9\u30ef\u30fc\u30c9\u3084\u500b\u4eba\u60c5\u5831\u306a\u3069\u3001\u5916\u90e8\u306b\u516c\u958b\u3059\u3079\u304d\u3067\u306a\u3044\u30c7\u30fc\u30bf\u3082\u30d5\u30a3\u30fc\u30eb\u30c9\u306b\u542b\u3093\u3067\u3044\u308b\u3053\u3068\u304c\u3088\u304f\u3042\u308a\u307e\u3059\u3002\n  <\/p>\n<p><strong>\u3010NG\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n<pre><code> @RestController\r\npublic class UserController {\r\n    @Autowired\r\n    private UserService userService;\r\n\r\n    @GetMapping(\"\/users\/{id}\")\r\n    public UserEntity getUser( @PathVariable Long id) {\r\n        \/\/ Entity\u3092\u305d\u306e\u307e\u307e\u8fd4\u3057\u3066\u3057\u307e\u3046\uff01\r\n        return userService.findUserById(id); \r\n    }\r\n}\r\n\/\/ \u30ec\u30b9\u30dd\u30f3\u30b9\u4f8b: {\"id\":1, \"username\":\"test\", \"password\":\"hashed_password_string\"}\r\n\/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\u304c\u5916\u90e8\u306b\u6f0f\u6d29\u3057\u3066\u3057\u307e\u3046\r\n<\/code><\/pre>\n<p>\n    <code> @JsonIgnore<\/code>\u3067\u9632\u3050\u65b9\u6cd5\u3082\u3042\u308a\u307e\u3059\u304c\u3001\u4ed8\u3051\u5fd8\u308c\u306e\u30ea\u30b9\u30af\u304c\u5e38\u306b\u4f34\u3044\u307e\u3059\u3002<br \/>\n    \u30ec\u30b9\u30dd\u30f3\u30b9\u306b\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u3060\u3051\u3092\u6301\u3064<strong>DTO<\/strong>\u306b\u8a70\u3081\u66ff\u3048\u308b\u3053\u3068\u3067\u3001\u3053\u306e\u30ea\u30b9\u30af\u3092\u6839\u672c\u304b\u3089\u65ad\u3061\u5207\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\n  <\/p>\n<p><strong>\u3010\u63a8\u5968\u30b3\u30fc\u30c9\u3011<\/strong><\/p>\n<pre><code> @GetMapping(\"\/users\/{id}\")\r\npublic UserDto getUser( @PathVariable Long id) {\r\n    \/\/ Service\u5c64\u3067Entity\u304b\u3089DTO\u3078\u5909\u63db\u3059\u308b\r\n    return userService.findUserByIdAsDto(id);\r\n}\r\n\r\n\/\/ UserService.java \u5185\u306e\u5909\u63db\u51e6\u7406\r\npublic UserDto findUserByIdAsDto(Long id) {\r\n    UserEntity entity = userRepository.findById(id).orElse(null);\r\n    if (entity == null) return null;\r\n\r\n    UserDto dto = new UserDto();\r\n    dto.setId(entity.getId());\r\n    dto.setUsername(entity.getUsername());\r\n    \/\/ \u30d1\u30b9\u30ef\u30fc\u30c9\u306f\u30bb\u30c3\u30c8\u3057\u306a\u3044\r\n    return dto;\r\n}\r\n<\/code><\/pre>\n<h3>\u30ea\u30b9\u30af\u2461\uff1aDB\u4fee\u6b63\u304c\u5373API\u7834\u58ca\u306b\u2026\u4fdd\u5b88\u6027\u3092\u4e0b\u3052\u308b\u300c\u5bc6\u7d50\u5408\u300d\u306e\u7f60<\/h3>\n<p><strong>Entity<\/strong>\u3092\u305d\u306e\u307e\u307e\u8fd4\u3059\u3068\u3001\u30c7\u30fc\u30bf\u5c64\u3068\u30d7\u30ec\u30bc\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u5c64\u304c\u300c\u5bc6\u7d50\u5408\u300d\u306a\u72b6\u614b\u306b\u306a\u308a\u307e\u3059\u3002 \u3053\u308c\u306f\u3001DB\u30b9\u30ad\u30fc\u30de\u306e\u5909\u66f4\u304c\u3001\u610f\u56f3\u305b\u305aAPI\u306e\u4ed5\u69d8\u5909\u66f4\u306b\u76f4\u7d50\u3057\u3066\u3057\u307e\u3046\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002<\/p>\n<p>\n    \u4f8b\u3048\u3070\u3001<strong>UserEntity<\/strong>\u306e<strong>username<\/strong>\u30d5\u30a3\u30fc\u30eb\u30c9\u3092<strong>nickname<\/strong>\u306b\u5909\u66f4\u3057\u305f\u3068\u3057\u307e\u3057\u3087\u3046\u3002<br \/>\n    <strong>Entity<\/strong\n    >\u3092\u76f4\u63a5\u8fd4\u3057\u3066\u3044\u308bAPI\u306f\u3001\u30ec\u30b9\u30dd\u30f3\u30b9JSON\u306e\u30ad\u30fc\u3082<strong>username<\/strong>\u304b\u3089<strong>nickname<\/strong>\u306b\u5909\u308f\u3063\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u3053\u306eAPI\u3092\u5229\u7528\u3057\u3066\u3044\u308b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306f\u3001\u7a81\u7136\u306e\u4ed5\u69d8\u5909\u66f4\u306b\u5bfe\u5fdc\u3067\u304d\u305a\u3001\u30a8\u30e9\u30fc\u3092\u5f15\u304d\u8d77\u3053\u3059\u3067\u3057\u3087\u3046\u3002\n  <\/p>\n<p>\n    <strong>DTO<\/strong\n    >\u3092\u9593\u306b\u631f\u3093\u3067\u3044\u308c\u3070\u3001<strong>Entity<\/strong>\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u304c\u5909\u308f\u3063\u3066\u3082\u3001Service\u5c64\u306e\u5909\u63db\u30ed\u30b8\u30c3\u30af\u3092\u4fee\u6b63\u3059\u308b\u3060\u3051\u3067\u6e08\u307f\u307e\u3059\u3002API\u306e\u4ed5\u69d8\u306f\u5909\u308f\u3089\u305a\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3078\u306e\u5f71\u97ff\u3092\u9632\u3052\u308b\u305f\u3081\u3001\u30b7\u30b9\u30c6\u30e0\u306e\u4fdd\u5b88\u6027\u304c\u8457\u3057\u304f\u5411\u4e0a\u3057\u307e\u3059\u3002\n  <\/p>\n<h3>\u30ea\u30b9\u30af\u2462\uff1a\u7121\u9650\u30eb\u30fc\u30d7\u3067\u30b5\u30fc\u30d0\u30fc\u30c0\u30a6\u30f3\uff1f\u300c\u5faa\u74b0\u53c2\u7167\u300d\u306e\u6050\u6016<\/h3>\n<p>\n    <strong>JPA<\/strong>\u3067\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\uff08\u4f8b: <strong>@OneToMany<\/strong>, <strong>@ManyToOne<\/strong>\uff09\u3092\u5b9a\u7fa9\u3057\u3066\u3044\u308b\u5834\u5408\u3001\u7279\u306b\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<br \/>\n    \u53cc\u65b9\u5411\u306e\u95a2\u9023\u3092\u6301\u3064<strong>Entity<\/strong>\u3092\u305d\u306e\u307e\u307eJSON\u306b\u5909\u63db\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001<strong>\u5faa\u74b0\u53c2\u7167<\/strong>\u304c\u767a\u751f\u3057\u3001\u7121\u9650\u30eb\u30fc\u30d7\u306b\u9665\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\uff08JSON\u306e\u57fa\u672c\u7684\u306a\u69cb\u9020\u3084\u6271\u3044\u65b9\u306b\u3064\u3044\u3066\u306f\u300e<a\n      href=\"https:\/\/route-zero.com\/recruit\/route\/1610\/\"\n      >JSON\u5b8c\u5168\u30ac\u30a4\u30c9\uff5c\u57fa\u790e\u304b\u3089API\u9023\u643a\u30fb\u8a2d\u8a08\u539f\u5247\u30fb\u30a8\u30e9\u30fc\u89e3\u6c7a\u307e\u3067<\/a\n    >\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09\n  <\/p>\n<p>\u4f8b\u3048\u3070\u3001\u300c\u30e6\u30fc\u30b6\u30fc(User)\u300d\u3068\u300c\u6295\u7a3f(Post)\u300d\u304c1\u5bfe\u591a\u306e\u95a2\u4fc2\u306b\u3042\u308b\u3068\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li><strong>UserEntity<\/strong>\u306f<strong>List&lt;PostEntity&gt;<\/strong>\u3092\u6301\u3064<\/li>\n<li><strong>PostEntity<\/strong>\u306f<strong>UserEntity<\/strong>\u3092\u6301\u3064<\/li>\n<\/ul>\n<p>\n    \u3053\u306e\u72b6\u614b\u3067<strong>UserEntity<\/strong>\u3092\u53d6\u5f97\u3057\u3066JSON\u306b\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u300cUser \u2192 Post\u30ea\u30b9\u30c8 \u2192 \u5404Post\u306eUser \u2192<br \/>\n    User\u306ePost\u30ea\u30b9\u30c8\u2026\u300d\u3068\u3044\u3046\u7121\u9650\u30eb\u30fc\u30d7\u304c\u767a\u751f\u3057\u3001<strong>StackOverflowError<\/strong>\u3067\u30b5\u30fc\u30d0\u30fc\u304c\u30c0\u30a6\u30f3\u3059\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n    <strong>DTO<\/strong>\u306b\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u3060\u3051\u3092\u8a70\u3081\u308b\u3053\u3068\u3067\u3001\u3053\u3046\u3057\u305f\u5faa\u74b0\u53c2\u7167\u3092\u65ad\u3061\u5207\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\n  <\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u5bc6\u7d50\u5408<\/strong><br \/>\n      \u30b7\u30b9\u30c6\u30e0\u306e\u90e8\u54c1\u540c\u58eb\u304c\u5f37\u304f\u4f9d\u5b58\u3057\u5408\u3063\u3066\u3044\u308b\u72b6\u614b\u3002\u4e00\u65b9\u306e\u5909\u66f4\u304c\u4ed6\u65b9\u306b\u5927\u304d\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u4fdd\u5b88\u6027\u3084\u67d4\u8edf\u6027\u304c\u4f4e\u304f\u306a\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u5faa\u74b0\u53c2\u7167<\/strong><br \/>\n      \u30aa\u30d6\u30b8\u30a7\u30af\u30c8A\u304cB\u3092\u3001B\u304cA\u3092\u2026\u3068\u3044\u3046\u3088\u3046\u306b\u304a\u4e92\u3044\u3092\u53c2\u7167\u3057\u5408\u3044\u3001\u30eb\u30fc\u30d7\u304c\u3067\u304d\u3066\u3057\u307e\u3046\u72b6\u614b\u3002JSON\u5909\u63db\u6642\u306a\u3069\u306b\u7121\u9650\u30eb\u30fc\u30d7\u3092\u5f15\u304d\u8d77\u3053\u3057\u3001\u30a8\u30e9\u30fc\u306e\u539f\u56e0\u3068\u306a\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aStackOverflowError<\/strong><br \/>\n      \u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u547c\u3073\u51fa\u3057\u968e\u5c64\u304c\u6df1\u304f\u306a\u308a\u3059\u304e\u3066\u3001\u30e1\u30e2\u30ea\u9818\u57df\u3092\u4f7f\u3044\u679c\u305f\u3057\u305f\u3068\u304d\u306b\u767a\u751f\u3059\u308b\u81f4\u547d\u7684\u306a\u30a8\u30e9\u30fc\u3002\u5faa\u74b0\u53c2\u7167\u304c\u4ee3\u8868\u7684\u306a\u539f\u56e0\u306e\u4e00\u3064\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>DTO vs Entity vs Model\uff1a\u4e00\u89a7\u6bd4\u8f03\u8868<\/h2>\n<p>\u3053\u3053\u307e\u3067\u306e\u5185\u5bb9\u3092\u4e00\u89a7\u8868\u306b\u307e\u3068\u3081\u307e\u3057\u305f\u3002\u3044\u3064\u3067\u3082\u898b\u8fd4\u305b\u308b\u8f9e\u66f8\u3068\u3057\u3066\u6d3b\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u9805\u76ee<\/th>\n<th>Entity (\u30a8\u30f3\u30c6\u30a3\u30c6\u30a3)<\/th>\n<th>DTO (\u30c7\u30fc\u30bf\u8ee2\u9001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8)<\/th>\n<th>Model (\u30e2\u30c7\u30eb)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>\u76ee\u7684<\/strong><\/td>\n<td>DB\u3068\u306e\u6c38\u7d9a\u5316\u3001\u30c7\u30fc\u30bf\u306e\u6838<\/td>\n<td>\u30ec\u30a4\u30e4\u30fc\u9593\u306e\u30c7\u30fc\u30bf\u8ee2\u9001<\/td>\n<td>\u6587\u8108\u306b\u3088\u308b\uff08\u30d3\u30b8\u30cd\u30b9\u30ed\u30b8\u30c3\u30af\u3001\u30c7\u30fc\u30bf\u5168\u822c\u306a\u3069\uff09<\/td>\n<\/tr>\n<tr>\n<td><strong>\u4e3b\u306a\u5229\u7528\u7b87\u6240<\/strong><\/td>\n<td>Repository\u5c64, Service\u5c64<\/td>\n<td>Controller\u5c64, Service\u5c64<\/td>\n<td>\u6587\u8108\u306b\u3088\u308b<\/td>\n<\/tr>\n<tr>\n<td><strong>\u72b6\u614b<\/strong><\/td>\n<td>\u53ef\u5909 (Mutable)<\/td>\n<td>\u53ef\u5909\u3082\u4e0d\u5909(Immutable)\u3082\u6709\u308a<\/td>\n<td>\u6587\u8108\u306b\u3088\u308b<\/td>\n<\/tr>\n<tr>\n<td><strong>\u4e3b\u8981\u306a\u30d5\u30a3\u30fc\u30eb\u30c9<\/strong><\/td>\n<td>DB\u30c6\u30fc\u30d6\u30eb\u306e\u30ab\u30e9\u30e0\u306b\u4e00\u81f4<\/td>\n<td>\u5916\u90e8\u3068\u306e\u901a\u4fe1\u306b\u5fc5\u8981\u306a\u30c7\u30fc\u30bf\u306e\u307f<\/td>\n<td>\u6587\u8108\u306b\u3088\u308b<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u53ef\u5909\uff08Mutable\uff09<\/strong><br \/>\n      \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4f5c\u6210\u3055\u308c\u305f\u5f8c\u3067\u3082\u3001\u305d\u306e\u4e2d\u8eab\uff08\u72b6\u614b\uff09\u3092\u5909\u66f4\u3067\u304d\u308b\u3053\u3068\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u4e0d\u5909\uff08Immutable\uff09<\/strong><br \/>\n      \u4e00\u5ea6\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4f5c\u6210\u3055\u308c\u308b\u3068\u3001\u305d\u306e\u4e2d\u8eab\uff08\u72b6\u614b\uff09\u3092\u5909\u66f4\u3067\u304d\u306a\u3044\u3053\u3068\u3002\u30c7\u30fc\u30bf\u306e\u5b89\u5168\u6027\u304c\u9ad8\u307e\u308b\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>Spring Boot\uff1a\u7406\u60f3\u7684\u306a\u4f7f\u3044\u5206\u3051\u30b3\u30fc\u30c9\u4f8b<\/h2>\n<p>\u305d\u308c\u3067\u306f\u3001<strong>Spring Boot<\/strong>\u3092\u4f7f\u3063\u305f\u5177\u4f53\u7684\u306a\u30b3\u30fc\u30c9\u3067\u3001\u7406\u60f3\u7684\u306a\u4f7f\u3044\u5206\u3051\u3092\u898b\u3066\u3044\u304d\u307e\u3057\u3087\u3046\u3002<\/p>\n<h3>1. Controller\u5c64\uff1a<strong>UserDTO<\/strong> \u3067\u30ea\u30af\u30a8\u30b9\u30c8\/\u30ec\u30b9\u30dd\u30f3\u30b9<\/h3>\n<pre><code>\/\/ UserController.java\r\n @RestController @RequestMapping(\"\/users\")\r\npublic class UserController {\r\n\r\n    private final UserService userService;\r\n\r\n    public UserController(UserService userService) {\r\n        this.userService = userService;\r\n    }\r\n\r\n    @GetMapping(\"\/{id}\")\r\n    public ResponseEntity&lt;UserDto&gt; getUserById( @PathVariable Long id) {\r\n        UserDto userDto = userService.getUserById(id);\r\n        return ResponseEntity.ok(userDto);\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>Controller\u306f<strong>UserDto<\/strong>\u306e\u307f\u3092\u6271\u3044\u3001<strong>UserEntity<\/strong>\u306e\u5b58\u5728\u3092\u77e5\u308a\u307e\u305b\u3093\u3002<\/p>\n<h3>2. Service\u5c64\uff1a<strong>Entity<\/strong> \u3092 <strong>DTO<\/strong> \u306b\u5909\u63db<\/h3>\n<pre><code>\/\/ UserServiceImpl.java\r\n @Service\r\npublic class UserServiceImpl implements UserService {\r\n\r\n    private final UserRepository userRepository;\r\n\r\n    public UserServiceImpl(UserRepository userRepository) {\r\n        this.userRepository = userRepository;\r\n    }\r\n\r\n    @Override\r\n    public UserDto getUserById(Long id) {\r\n        UserEntity userEntity = userRepository.findById(id)\r\n                .orElseThrow(() -> new RuntimeException(\"User not found\"));\r\n        \r\n        \/\/ \u3053\u3053\u3067Entity\u304b\u3089DTO\u3078\u306e\u5909\u63db\u3092\u884c\u3046\r\n        return convertToDto(userEntity);\r\n    }\r\n\r\n    private UserDto convertToDto(UserEntity entity) {\r\n        UserDto dto = new UserDto();\r\n        dto.setId(entity.getId());\r\n        dto.setUsername(entity.getUsername());\r\n        return dto;\r\n    }\r\n}\r\n<\/code><\/pre>\n<p>Service\u5c64\u304c<strong>Entity<\/strong>\u3068<strong>DTO<\/strong>\u306e\u6a4b\u6e21\u3057\u5f79\u3068\u306a\u308a\u3001\u5909\u63db\u306e\u8cac\u4efb\u3092\u8ca0\u3044\u307e\u3059\u3002<\/p>\n<h3>3. Repository\u5c64\uff1a<strong>Entity<\/strong> \u3067DB\u3068\u901a\u4fe1<\/h3>\n<pre><code>\/\/ UserRepository.java\r\n @Repository\r\npublic interface UserRepository extends JpaRepository&lt;UserEntity, Long&gt; {\r\n    \/\/ ...\r\n}\r\n<\/code><\/pre>\n<p>\n    Repository\u306f<strong>UserEntity<\/strong>\u306e\u307f\u3092\u6271\u3044\u3001DB\u3068\u306e\u901a\u4fe1\u306b\u5c02\u5ff5\u3057\u307e\u3059\u3002\uff08Spring Boot\u306b\u304a\u3051\u308bRepository\u306e\u5b9f\u88c5\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1670\/\"\n      >Spring Boot Repository\u5fb9\u5e95\u89e3\u8aac\uff5cJPA\u30fbnativeQuery\u306e\u4f7f\u3044\u65b9\u3068\u5931\u6557\u4f8b<\/a\n    >\u300f\u3092\u3054\u53c2\u7167\u304f\u3060\u3055\u3044\uff09\n  <\/p>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aSpring Boot<\/strong><br \/>\n      Java\u306b\u3088\u308bWeb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u3092\u7d20\u65e9\u304f\u7c21\u5358\u306b\u3059\u308b\u305f\u3081\u306e\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3002\u9762\u5012\u306a\u521d\u671f\u8a2d\u5b9a\u304c\u5c11\u306a\u304f\u3001\u3059\u3050\u306b\u958b\u767a\u3092\u59cb\u3081\u3089\u308c\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aDI\uff08Dependency Injection\uff09<\/strong><br \/>\n      \u300c\u4f9d\u5b58\u6027\u306e\u6ce8\u5165\u300d\u3068\u8a33\u3055\u308c\u308b\u3002\u30af\u30e9\u30b9\u304c\u5fc5\u8981\u3068\u3059\u308b\u5225\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u3001\u5916\u90e8\u304b\u3089\u4e0e\u3048\u308b\uff08\u6ce8\u5165\u3059\u308b\uff09\u8a2d\u8a08\u30d1\u30bf\u30fc\u30f3\u3002\u90e8\u54c1\u306e\u4ea4\u63db\u304c\u5bb9\u6613\u306b\u306a\u308a\u3001\u30c6\u30b9\u30c8\u3057\u3084\u3059\u3044\u30b3\u30fc\u30c9\u306b\u306a\u308b\u3002\uff08Spring<br \/>\n      Boot\u306b\u304a\u3051\u308bDI\u306e\u4ed5\u7d44\u307f\u306b\u3064\u3044\u3066\u306f\u300e<a href=\"https:\/\/route-zero.com\/recruit\/route\/1327\/\"\n        >Spring Boot \u306e @Autowired \u306f\u306a\u305c\u52d5\u304f\uff1fNullPointerException \u5bfe\u7b56\u304b\u3089\u5b66\u3076 DI\/IoC \u306e\u57fa\u672c\u3068\u300c\u6b63\u3057\u3044\u300d\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u7ba1\u7406\u8853<\/a\n      >\u300f\u3067\u8a73\u3057\u304f\u89e3\u8aac\u3057\u3066\u3044\u307e\u3059\uff09\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>\u9762\u5012\u306a\u5909\u63db\u4f5c\u696d\u3092\u81ea\u52d5\u5316\u3059\u308b2\u5927\u30e9\u30a4\u30d6\u30e9\u30ea<\/h2>\n<p>\u3068\u306f\u3044\u3048\u3001\u6bce\u56de\u624b\u52d5\u3067<strong>setter<\/strong>\/<strong>getter<\/strong>\u3092\u66f8\u304f\u306e\u306f\u3084\u306f\u308a\u9762\u5012\u3067\u3059\u3088\u306d\u3002 \u5e78\u3044\u3001\u3053\u306e\u5909\u63db\u51e6\u7406\u3092\u81ea\u52d5\u5316\u3057\u3066\u304f\u308c\u308b\u4fbf\u5229\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u5b58\u5728\u3057\u307e\u3059\u3002<\/p>\n<h3>\u624b\u52d5\u5909\u63db\u306e\u9650\u754c\u3068\u30ea\u30b9\u30af<\/h3>\n<p>\u624b\u52d5\u3067\u306e\u5909\u63db\u306f\u3001\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u5897\u3048\u308b\u307b\u3069\u30b3\u30fc\u30c9\u304c\u80a5\u5927\u5316\u3057\u3001\u5358\u7d14\u306a\u30df\u30b9\uff08\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u8a70\u3081\u5fd8\u308c\u306a\u3069\uff09\u304c\u767a\u751f\u3057\u3084\u3059\u304f\u306a\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u54c1\u8cea\u4f4e\u4e0b\u3068\u958b\u767a\u52b9\u7387\u306e\u60aa\u5316\u306b\u76f4\u7d50\u3057\u307e\u3059\u3002<\/p>\n<h3>MapStruct vs ModelMapper\uff1a\u6bd4\u8f03\u8868\u3067\u89e3\u8aac<\/h3>\n<p>\u4ee3\u8868\u7684\u306a\u5909\u63db\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3042\u308b<strong>MapStruct<\/strong>\u3068<strong>ModelMapper<\/strong>\u3092\u6bd4\u8f03\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<table>\n<thead>\n<tr>\n<th>\u89b3\u70b9<\/th>\n<th>MapStruct<\/th>\n<th>ModelMapper<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><strong>\u51e6\u7406\u30bf\u30a4\u30df\u30f3\u30b0<\/strong><\/td>\n<td><strong>\u30b3\u30f3\u30d1\u30a4\u30eb\u6642<\/strong><\/td>\n<td><strong>\u5b9f\u884c\u6642<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9<\/strong><\/td>\n<td><strong>\u9ad8\u901f<\/strong> (\u30cd\u30a4\u30c6\u30a3\u30d6Java\u30b3\u30fc\u30c9\u3092\u751f\u6210)<\/td>\n<td>\u6bd4\u8f03\u7684\u4f4e\u901f (\u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3\u4f7f\u7528)<\/td>\n<\/tr>\n<tr>\n<td><strong>\u578b\u5b89\u5168\u6027<\/strong><\/td>\n<td><strong>\u9ad8\u3044<\/strong> (\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u30a8\u30e9\u30fc\u691c\u77e5)<\/td>\n<td>\u4f4e\u3044 (\u5b9f\u884c\u6642\u307e\u3067\u30a8\u30e9\u30fc\u304c\u5206\u304b\u3089\u306a\u3044)<\/td>\n<\/tr>\n<tr>\n<td><strong>\u5b66\u7fd2\u30b3\u30b9\u30c8<\/strong><\/td>\n<td>\u3084\u3084\u9ad8\u3044 (\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u306e\u5b66\u7fd2\u304c\u5fc5\u8981)<\/td>\n<td><strong>\u4f4e\u3044<\/strong> (\u76f4\u611f\u7684\u306b\u4f7f\u3048\u308b)<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u7d50\u8ad6\u3068\u3057\u3066\u3001\u591a\u304f\u306e\u5b9f\u52d9\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3067\u306f\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u3068\u5b89\u5168\u6027\u306e\u89b3\u70b9\u304b\u3089<strong>MapStruct<\/strong>\u304c\u63a8\u5968\u3055\u308c\u308b\u50be\u5411\u306b\u3042\u308a\u307e\u3059\u3002<\/p>\n<h3>MapStruct\u3092\u4f7f\u3063\u305f\u5b9f\u88c5\u5165\u9580<\/h3>\n<p><strong>MapStruct<\/strong>\u306f\u3001\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9a\u7fa9\u3059\u308b\u3060\u3051\u3067\u3001\u305d\u306e\u5b9f\u88c5\u30af\u30e9\u30b9\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u81ea\u52d5\u751f\u6210\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<ol>\n<li>\u4f9d\u5b58\u95a2\u4fc2\u3092\u8ffd\u52a0 (Maven or Gradle)<\/li>\n<li>Mapper\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u4f5c\u6210<\/li>\n<\/ol>\n<pre><code>\/\/ UserMapper.java\r\n @Mapper(componentModel = \"spring\")\r\npublic interface UserMapper {\r\n    UserDto toDto(UserEntity entity);\r\n    UserEntity toEntity(UserDto dto);\r\n}\r\n<\/code><\/pre>\n<p>\u3053\u308c\u3060\u3051\u3067\u3001<strong>UserEntity<\/strong>\u3068<strong>UserDto<\/strong>\u306e\u30d5\u30a3\u30fc\u30eb\u30c9\u540d\u304c\u540c\u3058\u3067\u3042\u308c\u3070\u3001\u81ea\u52d5\u7684\u306b\u5909\u63db\u30b3\u30fc\u30c9\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre><code>\/\/ UserServiceImpl.java (MapStruct\u4f7f\u7528\u7248)\r\n\/\/ ...\r\nprivate final UserRepository userRepository;\r\nprivate final UserMapper userMapper; \/\/ DI\u3059\u308b\r\n\r\n\/\/ ...\r\n @Override\r\npublic UserDto getUserById(Long id) {\r\n    UserEntity userEntity = userRepository.findById(id)\r\n            .orElseThrow(() -> new RuntimeException(\"User not found\"));\r\n    \r\n    return userMapper.toDto(userEntity); \/\/ 1\u884c\u3067\u5909\u63db\u5b8c\u4e86\uff01\r\n}\r\n<\/code><\/pre>\n<blockquote>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aMapStruct<\/strong><br \/>\n      Java\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u9593\u306e\u30c7\u30fc\u30bf\u5909\u63db\u30b3\u30fc\u30c9\u3092\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u81ea\u52d5\u751f\u6210\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\u3002\u9ad8\u901f\u304b\u3064\u5b89\u5168\u6027\u304c\u9ad8\u3044\u306e\u304c\u7279\u5fb4\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1aModelMapper<\/strong><br \/>\n      \u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u6642\u306b\u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3\u3092\u5229\u7528\u3057\u3066\u30c7\u30fc\u30bf\u5909\u63db\u3092\u884c\u3046\u30e9\u30a4\u30d6\u30e9\u30ea\u3002\u624b\u8efd\u306b\u5c0e\u5165\u3067\u304d\u308b\u304c\u3001\u901f\u5ea6\u3084\u5b89\u5168\u6027\u3067\u52a3\u308b\u5834\u5408\u304c\u3042\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30b3\u30f3\u30d1\u30a4\u30eb\u6642 \/ \u5b9f\u884c\u6642<\/strong><br \/>\n      \u300c\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u300d\u306f\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u8a00\u8a9e\u3092\u6a5f\u68b0\u304c\u8aad\u3081\u308b\u5f62\u5f0f\u306b\u5909\u63db\u3059\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3002\u300c\u5b9f\u884c\u6642\u300d\u306f\u5b9f\u969b\u306b\u30d7\u30ed\u30b0\u30e9\u30e0\u304c\u52d5\u4f5c\u3057\u3066\u3044\u308b\u30bf\u30a4\u30df\u30f3\u30b0\u3002\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u30a8\u30e9\u30fc\u304c\u308f\u304b\u308b\u65b9\u304c\u3001\u65e9\u671f\u306b\u554f\u984c\u3092\u89e3\u6c7a\u3067\u304d\u308b\u3002\n    <\/p>\n<p>\n      <strong>\u7528\u8a9e\u89e3\u8aac\uff1a\u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3<\/strong><br \/>\n      \u30d7\u30ed\u30b0\u30e9\u30e0\u5b9f\u884c\u4e2d\u306b\u3001\u30d7\u30ed\u30b0\u30e9\u30e0\u81ea\u8eab\u306e\u69cb\u9020\uff08\u30af\u30e9\u30b9\u540d\u3001\u30e1\u30bd\u30c3\u30c9\u540d\u306a\u3069\uff09\u3092\u52d5\u7684\u306b\u8abf\u3079\u305f\u308a\u64cd\u4f5c\u3057\u305f\u308a\u3059\u308b\u9ad8\u5ea6\u306a\u6a5f\u80fd\u3002\u67d4\u8edf\u6027\u304c\u9ad8\u3044\u53cd\u9762\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u4f4e\u4e0b\u306e\u539f\u56e0\u306b\u306a\u308a\u3084\u3059\u3044\u3002\n    <\/p>\n<\/blockquote>\n<hr \/>\n<h2>\u307e\u3068\u3081\uff1a\u8a2d\u8a08\u601d\u60f3\u3092\u7406\u89e3\u3057\u3001\u81ea\u4fe1\u306e\u6301\u3066\u308b\u30b3\u30fc\u30c9\u3078 &#x2705;<\/h2>\n<p>\n    <strong>DTO<\/strong>\u3068<strong>Entity<\/strong>\u306e\u5206\u96e2\u306f\u3001\u5358\u306a\u308b\u300c\u9762\u5012\u306a\u30eb\u30fc\u30eb\u300d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 \u30b7\u30b9\u30c6\u30e0\u306e\u5b89\u5168\u6027\u3001\u4fdd\u5b88\u6027\u3001\u305d\u3057\u3066\u62e1\u5f35\u6027\u3092\u9ad8\u3081\u308b\u305f\u3081\u306e\u3001\u5148\u4eba\u305f\u3061\u306e\u77e5\u6075\u304c\u8a70\u307e\u3063\u305f\u91cd\u8981\u306a\u8a2d\u8a08\u601d\u60f3\u3067\u3059\u3002\n  <\/p>\n<p>\n    \u4eca\u56de\u306e\u5185\u5bb9\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u3067\u3001\u3042\u306a\u305f\u306f\u3082\u3046\u300c\u306a\u305c\uff1f\u300d\u3068\u7591\u554f\u306b\u601d\u3046\u3053\u3068\u306a\u304f\u3001\u81ea\u4fe1\u3092\u6301\u3063\u3066\u5909\u63db\u51e6\u7406\u3092\u5b9f\u88c5\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u306f\u305a\u3067\u3059\u3002<br \/>\n    \u305d\u3057\u3066\u3001\u305d\u306e\u4e00\u624b\u9593\u304c\u5c06\u6765\u306e\u81ea\u5206\u3084\u30c1\u30fc\u30e0\u3092\u52a9\u3051\u308b\u306e\u3060\u3068\u3001\u80f8\u3092\u5f35\u3063\u3066\u8a00\u3048\u308b\u3067\u3057\u3087\u3046\u3002\n  <\/p>\n<p>\u3055\u3089\u306b\u7406\u89e3\u3092\u6df1\u3081\u305f\u3044\u65b9\u306f\u3001\u305c\u3072\u300c\u30af\u30ea\u30fc\u30f3\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u300d\u3084\u300c\u30c9\u30e1\u30a4\u30f3\u99c6\u52d5\u8a2d\u8a08\uff08DDD\uff09\u300d\u306b\u3064\u3044\u3066\u3082\u5b66\u3093\u3067\u307f\u3066\u304f\u3060\u3055\u3044\u3002 \u306a\u305c\u30ec\u30a4\u30e4\u30fc\u3092\u5206\u3051\u308b\u306e\u304b\u3001\u305d\u306e\u7406\u7531\u304c\u3088\u308a\u7acb\u4f53\u7684\u306b\u898b\u3048\u3066\u304f\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<p><\/p>\n<p>\u305c\u3072\u30b3\u30fc\u30c9\u3092\u30b3\u30d4\u30da\u3057\u3066\u3001\u307e\u305a\u306f\u52d5\u304b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><\/p>\n<hr \/>\n<h2>FAQ\uff5c\u3088\u304f\u3042\u308b\u7591\u554f\u306b\u56de\u7b54<\/h2>\n<ul>\n<li>\n      <strong>Q1. DTO\u3068VO(Value Object)\u306e\u9055\u3044\u306f\u4f55\u3067\u3059\u304b\uff1f<\/strong><br \/>\n      A1.<br \/>\n      <strong>VO<\/strong\n      >\u306f\u300c\u5024\u305d\u306e\u3082\u306e\u300d\u3092\u8868\u73fe\u3059\u308b\u4e0d\u5909\uff08Immutable\uff09\u306a\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3001\u305d\u308c\u81ea\u4f53\u304c\u30ed\u30b8\u30c3\u30af\u3092\u6301\u3064\u3053\u3068\u304c\u3042\u308a\u307e\u3059\uff08\u4f8b\uff1a<strong>Email<\/strong>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306e\u5f62\u5f0f\u3092\u691c\u8a3c\u3059\u308b\uff09\u3002\u4e00\u65b9\u3001<strong>DTO<\/strong>\u306f\u4e3b\u306b\u30c7\u30fc\u30bf\u306e\u8ee2\u9001\u306b\u7279\u5316\u3057\u305f\u300c\u7bb1\u300d\u3067\u3042\u308a\u3001\u30ed\u30b8\u30c3\u30af\u306f\u6301\u305f\u305a\u3001\u53ef\u5909\uff08Mutable\uff09\u3067\u3042\u308b\u3053\u3068\u3082\u8a31\u5bb9\u3055\u308c\u307e\u3059\u3002\n    <\/li>\n<li>\n      <strong>Q2. Java\u306e<code>record<\/code>\u578b\u306fDTO\u306e\u4ee3\u308f\u308a\u306b\u4f7f\u3048\u307e\u3059\u304b\uff1f<\/strong><br \/>\n      A2. \u306f\u3044\u3001\u975e\u5e38\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002Java 16\u304b\u3089\u6b63\u5f0f\u5c0e\u5165\u3055\u308c\u305f<strong>record<\/strong>\u306f\u3001\u4e0d\u5909\u306a\u30c7\u30fc\u30bf\u30ad\u30e3\u30ea\u30a2\u3092\u7c21\u6f54\u306b\u5b9a\u7fa9\u3067\u304d\u308b\u305f\u3081\u3001\u7279\u306b\u30ec\u30b9\u30dd\u30f3\u30b9\u7528\u306e<strong>DTO<\/strong>\u3068\u3057\u3066\u7406\u60f3\u7684\u3067\u3059\u3002<\/p>\n<pre><code>\/\/ record\u3092\u4f7f\u3063\u305fDTO\u306e\u4f8b\r\npublic record UserDto(Long id, String username) {}\r\n<\/code><\/pre>\n<\/li>\n<li>\n      <strong>Q3. \u5909\u63db\u30e9\u30a4\u30d6\u30e9\u30ea\u306f<strong>MapStruct<\/strong>\u3068<strong>ModelMapper<\/strong>\u306e\u3069\u3061\u3089\u304c\u304a\u3059\u3059\u3081\u3067\u3059\u304b\uff1f<\/strong><br \/>\n      A3.<br \/>\n      \u30c1\u30fc\u30e0\u306e\u958b\u767a\u65b9\u91dd\u306b\u3082\u3088\u308a\u307e\u3059\u304c\u3001\u4e00\u822c\u7684\u306b\u306f<strong>MapStruct<\/strong>\u304c\u63a8\u5968\u3055\u308c\u307e\u3059\u3002\u30b3\u30f3\u30d1\u30a4\u30eb\u6642\u306b\u30b3\u30fc\u30c9\u3092\u81ea\u52d5\u751f\u6210\u3059\u308b\u305f\u3081\u3001\u5b9f\u884c\u6642\u306e\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u304c\u9ad8\u304f\u3001\u578b\u5b89\u5168\u3067\u3042\u308b\uff08\u30de\u30c3\u30d4\u30f3\u30b0\u3067\u304d\u306a\u3044\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u3042\u308c\u3070\u30b3\u30f3\u30d1\u30a4\u30eb\u30a8\u30e9\u30fc\u306b\u306a\u308b\uff09\u3068\u3044\u3046\u5927\u304d\u306a\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308b\u304b\u3089\u3067\u3059\u3002<strong>ModelMapper<\/strong>\u306f\u624b\u8efd\u3067\u3059\u304c\u3001\u5b9f\u884c\u6642\u306b\u30ea\u30d5\u30ec\u30af\u30b7\u30e7\u30f3\u3092\u4f7f\u3046\u305f\u3081\u6027\u80fd\u9762\u3067\u52a3\u308a\u3001\u30a8\u30e9\u30fc\u304c\u5b9f\u884c\u6642\u307e\u3067\u767a\u899a\u3057\u306a\u3044\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002\n    <\/li>\n<li>\n      <strong>Q4. \u5c0f\u898f\u6a21\u306a\u500b\u4eba\u958b\u767a\u3067\u3082\u3001DTO\u3078\u306e\u5909\u63db\u306f\u5fc5\u9808\u3067\u3059\u304b\uff1f<\/strong><br \/>\n      A4.<br \/>\n      \u5fc5\u9808\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002\u901f\u5ea6\u3092\u6700\u512a\u5148\u3059\u308b\u30d7\u30ed\u30c8\u30bf\u30a4\u30d4\u30f3\u30b0\u306a\u3069\u3067\u306f\u3001Entity\u3092\u76f4\u63a5\u5229\u7528\u3059\u308b\u5224\u65ad\u3082\u6709\u308a\u5f97\u307e\u3059\u3002\u3057\u304b\u3057\u3001\u5c06\u6765\u7684\u306a\u6a5f\u80fd\u8ffd\u52a0\u3084\u5909\u66f4\u3092\u898b\u8d8a\u3059\u306e\u3067\u3042\u308c\u3070\u3001\u305f\u3068\u3048\u5c0f\u898f\u6a21\u3067\u3042\u3063\u3066\u3082\u6700\u521d\u304b\u3089<strong>DTO<\/strong>\u3068<strong>Entity<\/strong>\u3092\u5206\u96e2\u3057\u3066\u304a\u304f\u306e\u304c\u3001\u7d50\u679c\u7684\u306b\u4fdd\u5b88\u6027\u3092\u9ad8\u3081\u308b\u826f\u3044\u7fd2\u6163\u3068\u8a00\u3048\u308b\u3067\u3057\u3087\u3046\u3002\n    <\/li>\n<li>\n      <strong>Q5. \u6bce\u56de\u5909\u63db\u51e6\u7406\u3092\u66f8\u304f\u3068\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u5f71\u97ff\u306f\u3042\u308a\u307e\u305b\u3093\u304b\uff1f<\/strong><br \/>\n      A5.<br \/>\n      \u307b\u3068\u3093\u3069\u306e\u5834\u5408\u3001\u5fc3\u914d\u3042\u308a\u307e\u305b\u3093\u3002\u624b\u52d5\u3067\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u751f\u6210\u3084<strong>MapStruct<\/strong>\u304c\u751f\u6210\u3059\u308b\u30b3\u30fc\u30c9\u306b\u3088\u308b\u30aa\u30fc\u30d0\u30fc\u30d8\u30c3\u30c9\u306f\u3001DB\u30a2\u30af\u30bb\u30b9\u3084\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u901a\u4fe1\u3068\u3044\u3063\u305f\u4ed6\u306e\u51e6\u7406\u6642\u9593\u306b\u6bd4\u3079\u3066\u7121\u8996\u3067\u304d\u308b\u307b\u3069\u5c0f\u3055\u3044\u3067\u3059\u3002\u3080\u3057\u308d\u3001<strong>Entity<\/strong>\u3092\u76f4\u63a5\u6271\u3046\u3053\u3068\u3067\u767a\u751f\u3057\u3046\u308bN+1\u554f\u984c\u3084\u610f\u56f3\u305b\u306c\u30c7\u30fc\u30bf\u53d6\u5f97\u306e\u65b9\u304c\u3001\u30d1\u30d5\u30a9\u30fc\u30de\u30f3\u30b9\u306b\u6df1\u523b\u306a\u5f71\u97ff\u3092\u4e0e\u3048\u308b\u53ef\u80fd\u6027\u304c\u9ad8\u3044\u3067\u3059\u3002\n    <\/li>\n<\/ul>\n<hr \/>\n<\/div>\n","protected":false},"featured_media":1883,"template":"","_links":{"self":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/route\/1882"}],"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\/1883"}],"wp:attachment":[{"href":"https:\/\/route-zero.com\/recruit\/wp-json\/wp\/v2\/media?parent=1882"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}