Tag: mapsid

  • What is @MapsId used for in JPA/Hibernate? – Part II

    In the previous post , we saw how and why to use @MapsId in a One to One relationship. In this post , lets see how it comes handy in a One to Many relationship. Let’s take the same Musician entity as the parent object. Let’s take an Album entity as the child object. A…

  • What is @MapsId used for in JPA/hibernate? – Part 1

    @MapsId annotation. If you ever wondered what this annotation is for , here is an in depth analysis of it: When is this annotation used? It is used if the primary key of a child table is the same as the primary key of a parent table Why is this used? By specifying the annotation…