MappedBy signals hibernate that the key for the relationship is on the other side.
This means that although you link 2 tables together, only 1 of those tables has a foreign key constraint to the other one. MappedBy allows you to still link from the table not containing the constraint to the other table.
More Related Contents:
- What’s the difference between JPA and Hibernate? [closed]
- How to map calculated properties with JPA and Hibernate
- When to use EntityManager.find() vs EntityManager.getReference() with JPA
- In which case do you use the JPA @JoinTable annotation?
- @PreUpdate and @Prepersist in hibernate/JPA (using session)
- Hibernate bidirectional @ManyToOne, updating the not owning side not working
- JPA Multiple Embedded fields
- Difference between @MapKey, @MapKeyColumn and @MapKeyJoinColumn in JPA and Hibernate
- Hibernate throws strange error: Class is not mapped
- org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple bags
- JPA: difference between @JoinColumn and @PrimaryKeyJoinColumn?
- having an exception when saving oracle type object in some entity
- How can I make a JPA OneToOne relation lazy
- org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when ‘hibernate.dialect’ not set
- How to fetch FetchType.LAZY associations with JPA and Hibernate in a Spring Controller
- How to generate the JPA entity Metamodel?
- Hibernate: Automatically creating/updating the db tables based on entity classes
- JPA Hibernate One-to-One relationship
- Could not serialize object cause of HibernateProxy
- Why does Hibernate disable INSERT batching when using an IDENTITY identifier generator
- Hibernate table not mapped error in HQL query
- No Persistence provider for EntityManager named X
- Hibernate recursive many-to-many association with the same entity
- Deploying application using Hibernate JPA 2.1 to IBM WebSphere gives NullPointerException
- persistence.xml different transaction-type attributes
- JPA (Hibernate) and custom table prefixes
- Hibernate native query – char(3) column
- Why should anybody put annotations on the getters or setters when using JPA to map the classes?
- Hibernate using JPA (annotated Entities) and liquibase
- Mapping JPA or Hibernate projection query to DTO (Data Transfer Object)