{"id":2461,"date":"2015-11-28T11:55:22","date_gmt":"2015-11-28T09:55:22","guid":{"rendered":"https:\/\/adrhc.go.ro\/wordpress\/?p=2461"},"modified":"2017-05-10T22:13:44","modified_gmt":"2017-05-10T20:13:44","slug":"mapkey-vs-mapkeycolumn","status":"publish","type":"post","link":"https:\/\/adrhc.go.ro\/blog\/mapkey-vs-mapkeycolumn\/","title":{"rendered":"@MapKey vs @MapKeyColumn"},"content":{"rendered":"<pre class=\"brush: java\">\r\n\/\/ @MapKey refers the field\/property (unique one) in the Entity witch is the value of a Map field\/property\r\n\/\/ @MapKeyColumn refers the column in an @ElementCollection\r\n\r\n@Entity\r\npublic class Person6 {\r\n    @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true, mappedBy = \"person6\")\r\n    @MapKey(name = \"address\") \/\/ is the Address6's address property\r\n    public Map&lt;String, Address6> getAddress6Map() {\r\n        return address6Map;\r\n    }\r\n...\r\n\r\n@Entity\r\npublic class Address6 {\r\n    private Integer id;\r\n    private String address;\r\n    private Person6 person6;\r\n...\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ @MapKey refers the field\/property (unique one) in the Entity witch is the value of a Map field\/property \/\/ @MapKeyColumn refers the column in an @ElementCollection @Entity public class Person6 { @OneToMany(fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true, [&hellip;]<\/p>\n<div class=\"link-more\"><a href=\"https:\/\/adrhc.go.ro\/blog\/mapkey-vs-mapkeycolumn\/#more-2461\" class=\"more-link\">Continue reading &#10142; <span class=\"screen-reader-text\">@MapKey vs @MapKeyColumn<\/span><\/a><\/div>","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,36,10],"tags":[76],"class_list":["post-2461","post","type-post","status-publish","format-standard","hentry","category-database","category-java","category-programming","tag-jpa"],"_links":{"self":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/2461","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/comments?post=2461"}],"version-history":[{"count":0,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/posts\/2461\/revisions"}],"wp:attachment":[{"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/media?parent=2461"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/categories?post=2461"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/adrhc.go.ro\/blog\/wp-json\/wp\/v2\/tags?post=2461"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}