{"id":140,"date":"2019-03-15T19:03:27","date_gmt":"2019-03-15T19:03:27","guid":{"rendered":"https:\/\/www.kindsonthegenius.com\/spring-boot\/?p=140"},"modified":"2019-06-19T16:23:04","modified_gmt":"2019-06-19T16:23:04","slug":"spring-boot-entity-relationship","status":"publish","type":"post","link":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/","title":{"rendered":"Spring Boot &#8211; Understanding Entity Relationships"},"content":{"rendered":"<p>In this lesson, we are going to add entity relationships between the classes.<\/p>\n<p>First lets look ate the relationship between the classes. This is shown in Figure 1.0<\/p>\n<p>&nbsp;<\/p>\n<figure id=\"attachment_141\" aria-describedby=\"caption-attachment-141\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/03\/ER-Diagram.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-141 size-medium\" src=\"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/03\/ER-Diagram-300x162.jpg\" alt=\"\" width=\"300\" height=\"162\" srcset=\"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/03\/ER-Diagram-300x162.jpg 300w, https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/03\/ER-Diagram-768x413.jpg 768w, https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/03\/ER-Diagram.jpg 938w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-141\" class=\"wp-caption-text\">Figure 1.0: Relationship diagram for our SocialAPI<\/figcaption><\/figure>\n<ol>\n<li><a href=\"#t1\">User-Location Relationship<\/a><\/li>\n<li><a href=\"#t2\">Post-User Relationship<\/a><\/li>\n<li><a href=\"#t3\">Get User by Location<\/a><\/li>\n<li><a href=\"#t4\">Get Post by User<\/a><\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t1\">1. User-Location Relationship<\/strong><\/h4>\n<p>This is an example of has-a relationship. This means that a user object has a location. Also a Location can have more than on user. Or many users can share one location. Therefore we call this relationship many-to-one.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Add the @ManyToOne Annotation to the User class<\/strong><\/p>\n<p>Add the @ManyToOne annotation to the User class under the Location member variable. This is as shown below:<\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #555555; font-weight: bold;\">@Entity<\/span>\r\n<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">User<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\t\r\n    <span style=\"color: #555555; font-weight: bold;\">@Id<\/span>\r\n    <span style=\"color: #008800; font-weight: bold;\">private<\/span> String id<span style=\"color: #333333;\">;<\/span>\r\n    <span style=\"color: #008800; font-weight: bold;\">private<\/span> String firstname<span style=\"color: #333333;\">;<\/span>\r\n    <span style=\"color: #008800; font-weight: bold;\">private<\/span> String lastname<span style=\"color: #333333;\">;<\/span>\r\n    \r\n    <span style=\"color: #555555; font-weight: bold;\">@ManyToOne<\/span>\r\n    <span style=\"color: #008800; font-weight: bold;\">private<\/span> Location location<span style=\"color: #333333;\">;<\/span>  \r\n    \r\n    <span style=\"color: #008800; font-weight: bold;\">private<\/span> String email<span style=\"color: #333333;\">;<\/span>\r\n    <span style=\"color: #333333;\">...<\/span>\r\n    <span style=\"color: #333333;\">...<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t2\">2. Post-User Relationship<\/strong><\/h4>\n<p>This is also an example of <strong><em>has-a<\/em><\/strong> relationship. This means that a user object has a location. Also a User can have more than on Post. Or many Post can be created by one User. In. Therefore we also call this relationship many-to-one.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>Add the @ManyToOne Annotation to the Post class<\/strong><\/p>\n<p>Add the <em>@ManyToOne<\/em> annotation to the Post class under the User member variable.<\/p>\n<p>This is as shown below:<\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #555555; font-weight: bold;\">@Entity<\/span>\r\n<span style=\"color: #008800; font-weight: bold;\">public<\/span> <span style=\"color: #008800; font-weight: bold;\">class<\/span> <span style=\"color: #bb0066; font-weight: bold;\">Post<\/span> <span style=\"color: #333333;\">{<\/span>\r\n\t\r\n   <span style=\"color: #555555; font-weight: bold;\">@Id<\/span>\r\n   <span style=\"color: #008800; font-weight: bold;\">private<\/span> String id<span style=\"color: #333333;\">;<\/span>\r\n   <span style=\"color: #008800; font-weight: bold;\">private<\/span> String postdate<span style=\"color: #333333;\">;<\/span>\r\n   \r\n   <span style=\"color: #555555; font-weight: bold;\">@ManyToOne<\/span>\r\n   <span style=\"color: #008800; font-weight: bold;\">private<\/span> User user<span style=\"color: #333333;\">;<\/span>\r\n   \r\n   <span style=\"color: #008800; font-weight: bold;\">private<\/span> String details<span style=\"color: #333333;\">;<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t3\">3. Getting Users by Location<\/strong><\/h4>\n<p>Since many Users can have one Location, we would like to get List of User by Location. To do this, we need to write the definition in the UserRepository interface.<\/p>\n<p>Open the UserRepository class and write add the line below.<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\">   <span style=\"color: #008800; font-weight: bold;\">public<\/span> List<span style=\"color: #333333;\">&lt;<\/span>User<span style=\"color: #333333;\">&gt;<\/span> <span style=\"color: #0066bb; font-weight: bold;\">findByLocationId<\/span><span style=\"color: #333333;\">(<\/span>String locationId<span style=\"color: #333333;\">);<\/span> \r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Now we need to add similar method to the UserService.<\/p>\n<p>The method is similar to getAllUsers, but this time we use getUsersByLocationId. The code is given below:<\/p>\n<p>&nbsp;<\/p>\n<p><!-- HTML generated using hilite.me --><\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008800; font-weight: bold;\">public<\/span> List<span style=\"color: #333333;\">&lt;<\/span>User<span style=\"color: #333333;\">&gt;<\/span> <span style=\"color: #0066bb; font-weight: bold;\">getUsersByLocation<\/span><span style=\"color: #333333;\">(<\/span>String id<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\r\n    List<span style=\"color: #333333;\">&lt;<\/span>User<span style=\"color: #333333;\">&gt;<\/span> users <span style=\"color: #333333;\">=<\/span> <span style=\"color: #008800; font-weight: bold;\">new<\/span> ArrayList<span style=\"color: #333333;\">&lt;&gt;();<\/span>\r\n\t\r\n    userRepository<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">findByLocationId<\/span><span style=\"color: #333333;\">(<\/span>id<span style=\"color: #333333;\">)<\/span>\r\n    <span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">forEach<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #997700; font-weight: bold;\">users:<\/span><span style=\"color: #333333;\">:<\/span>add<span style=\"color: #333333;\">);<\/span>\r\n\t\r\n    <span style=\"color: #008800; font-weight: bold;\">return<\/span> users<span style=\"color: #333333;\">;<\/span>\r\n<span style=\"color: #333333;\">}<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<h4><strong id=\"t4\">4. Getting Posts By User<\/strong><\/h4>\n<p>Since many Posts can be made by on user, we would like to get List of Post by User. To do this, we need to write the definition in the PostRepository interface.<\/p>\n<p>Open the PostRepository class and write add the line below.<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\">   <span style=\"color: #008800; font-weight: bold;\">public<\/span> List<span style=\"color: #333333;\">&lt;<\/span>Post<span style=\"color: #333333;\">&gt;<\/span> <span style=\"color: #0066bb; font-weight: bold;\">findByUserId<\/span><span style=\"color: #333333;\">(<\/span>String userId<span style=\"color: #333333;\">);<\/span><\/pre>\n<p>&nbsp;<\/p>\n<p>Then we add a similar method to the PostService. The method would be getPostsByUserId. The code is given below:<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0; line-height: 125%;\"><span style=\"color: #008800; font-weight: bold;\">public<\/span> List<span style=\"color: #333333;\">&lt;<\/span>Post<span style=\"color: #333333;\">&gt;<\/span> <span style=\"color: #0066bb; font-weight: bold;\">getPostsByUser<\/span><span style=\"color: #333333;\">(<\/span>String id<span style=\"color: #333333;\">)<\/span> <span style=\"color: #333333;\">{<\/span>\r\n   List<span style=\"color: #333333;\">&lt;<\/span>Post<span style=\"color: #333333;\">&gt;<\/span> posts <span style=\"color: #333333;\">=<\/span> <span style=\"color: #008800; font-weight: bold;\">new<\/span> ArrayList<span style=\"color: #333333;\">&lt;&gt;();<\/span>\r\n   \r\n   postRepository<span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">findByUserId<\/span><span style=\"color: #333333;\">(<\/span>id<span style=\"color: #333333;\">)<\/span>\r\n   <span style=\"color: #333333;\">.<\/span><span style=\"color: #0000cc;\">forEach<\/span><span style=\"color: #333333;\">(<\/span><span style=\"color: #997700; font-weight: bold;\">posts:<\/span><span style=\"color: #333333;\">:<\/span>add<span style=\"color: #333333;\">);<\/span>\r\n   \r\n   <span style=\"color: #008800; font-weight: bold;\">return<\/span> posts<span style=\"color: #333333;\">;<\/span>\t \r\n<span style=\"color: #333333;\">}<\/span>\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>Now we&#8217;ve come this far. But we are not done yet. We need to write the controller methods. But before do that I would like to explain a bit about RequestMappings. This we would look cover in the next Chapter.<\/p>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>In this lesson, we are going to add entity relationships between the classes. First lets look ate the relationship between the classes. This is shown &hellip; <!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":143,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[2],"tags":[],"class_list":["post-140","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-boot-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Spring Boot - Understanding Entity Relationships - Learn Spring Boot<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Spring Boot - Understanding Entity Relationships - Learn Spring Boot\" \/>\n<meta property=\"og:description\" content=\"In this lesson, we are going to add entity relationships between the classes. First lets look ate the relationship between the classes. This is shown &hellip;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn Spring Boot\" \/>\n<meta property=\"article:published_time\" content=\"2019-03-15T19:03:27+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-06-19T16:23:04+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/03\/Entity-Relationships.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"781\" \/>\n\t<meta property=\"og:image:height\" content=\"451\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"kindsonthegenius\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"kindsonthegenius\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-entity-relationship\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-entity-relationship\\\/\"},\"author\":{\"name\":\"kindsonthegenius\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/#\\\/schema\\\/person\\\/7f8fc5792578d2ff54003fcebe6c46b5\"},\"headline\":\"Spring Boot &#8211; Understanding Entity Relationships\",\"datePublished\":\"2019-03-15T19:03:27+00:00\",\"dateModified\":\"2019-06-19T16:23:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-entity-relationship\\\/\"},\"wordCount\":391,\"commentCount\":2,\"image\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-entity-relationship\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2019\\\/03\\\/Entity-Relationships.jpg\",\"articleSection\":[\"Spring Boot Tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-entity-relationship\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-entity-relationship\\\/\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-entity-relationship\\\/\",\"name\":\"Spring Boot - Understanding Entity Relationships - Learn Spring Boot\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-entity-relationship\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-entity-relationship\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2019\\\/03\\\/Entity-Relationships.jpg\",\"datePublished\":\"2019-03-15T19:03:27+00:00\",\"dateModified\":\"2019-06-19T16:23:04+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/#\\\/schema\\\/person\\\/7f8fc5792578d2ff54003fcebe6c46b5\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-entity-relationship\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-entity-relationship\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-entity-relationship\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2019\\\/03\\\/Entity-Relationships.jpg\",\"contentUrl\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/wp-content\\\/uploads\\\/sites\\\/7\\\/2019\\\/03\\\/Entity-Relationships.jpg\",\"width\":781,\"height\":451},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/spring-boot-entity-relationship\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Spring Boot &#8211; Understanding Entity Relationships\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/#website\",\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/\",\"name\":\"Learn Spring Boot\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/#\\\/schema\\\/person\\\/7f8fc5792578d2ff54003fcebe6c46b5\",\"name\":\"kindsonthegenius\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g\",\"caption\":\"kindsonthegenius\"},\"url\":\"https:\\\/\\\/www.kindsonthegenius.com\\\/spring-boot\\\/author\\\/kindsonthegenius-3\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Spring Boot - Understanding Entity Relationships - Learn Spring Boot","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/","og_locale":"en_US","og_type":"article","og_title":"Spring Boot - Understanding Entity Relationships - Learn Spring Boot","og_description":"In this lesson, we are going to add entity relationships between the classes. First lets look ate the relationship between the classes. This is shown &hellip;","og_url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/","og_site_name":"Learn Spring Boot","article_published_time":"2019-03-15T19:03:27+00:00","article_modified_time":"2019-06-19T16:23:04+00:00","og_image":[{"width":781,"height":451,"url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/03\/Entity-Relationships.jpg","type":"image\/jpeg"}],"author":"kindsonthegenius","twitter_card":"summary_large_image","twitter_misc":{"Written by":"kindsonthegenius","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/#article","isPartOf":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/"},"author":{"name":"kindsonthegenius","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/#\/schema\/person\/7f8fc5792578d2ff54003fcebe6c46b5"},"headline":"Spring Boot &#8211; Understanding Entity Relationships","datePublished":"2019-03-15T19:03:27+00:00","dateModified":"2019-06-19T16:23:04+00:00","mainEntityOfPage":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/"},"wordCount":391,"commentCount":2,"image":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/03\/Entity-Relationships.jpg","articleSection":["Spring Boot Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/","url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/","name":"Spring Boot - Understanding Entity Relationships - Learn Spring Boot","isPartOf":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/#primaryimage"},"image":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/#primaryimage"},"thumbnailUrl":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/03\/Entity-Relationships.jpg","datePublished":"2019-03-15T19:03:27+00:00","dateModified":"2019-06-19T16:23:04+00:00","author":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/#\/schema\/person\/7f8fc5792578d2ff54003fcebe6c46b5"},"breadcrumb":{"@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/#primaryimage","url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/03\/Entity-Relationships.jpg","contentUrl":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-content\/uploads\/sites\/7\/2019\/03\/Entity-Relationships.jpg","width":781,"height":451},{"@type":"BreadcrumbList","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/spring-boot-entity-relationship\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.kindsonthegenius.com\/spring-boot\/"},{"@type":"ListItem","position":2,"name":"Spring Boot &#8211; Understanding Entity Relationships"}]},{"@type":"WebSite","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/#website","url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/","name":"Learn Spring Boot","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.kindsonthegenius.com\/spring-boot\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.kindsonthegenius.com\/spring-boot\/#\/schema\/person\/7f8fc5792578d2ff54003fcebe6c46b5","name":"kindsonthegenius","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b9d710de456c3d85e5614c3a6992fa3d527425e2ab32b8bd5d85bfbaa235004b?s=96&d=mm&r=g","caption":"kindsonthegenius"},"url":"https:\/\/www.kindsonthegenius.com\/spring-boot\/author\/kindsonthegenius-3\/"}]}},"_links":{"self":[{"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/posts\/140","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/comments?post=140"}],"version-history":[{"count":5,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/posts\/140\/revisions"}],"predecessor-version":[{"id":166,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/posts\/140\/revisions\/166"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/media\/143"}],"wp:attachment":[{"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/media?parent=140"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/categories?post=140"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kindsonthegenius.com\/spring-boot\/wp-json\/wp\/v2\/tags?post=140"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}