Prev Next

Hibernate / Hibernate Interview Questions III

Difference between mappedBy and joinColumn In hibernate.

mappedBy.joinColumn.
The attribute mappedBy indicates that the entity in this side is the inverse of the relationship, and the owner resides in the "other" entity. The annotation @JoinColumn indicates that the entity is the owner of the relationship. This means that the corresponding table has a column with a foreign key to the referenced table.
You can access the other table from the class which you have annotated with "mappedBy" (fully bidirectional relationship).You cannot access other table and its one directional.

More Related questions...

Show more question and Answers...


Comments & Discussions