I'm studying for the JPA certification and I read this sentence in the book that I'm reading: "Ownership is important for mapping because the physical annotations that define the mappings to the columns in the database (for example, @JoinColumn) are always defined on the owning side of the relationship. If they are not there, the values are defaulted from the perspective of the attribute on the owning side."
I could not get the meaning of the last part, someone have an idea about what it could be?
Feel free to ask me anything!
www.BlackBeltFactory.com/ui#!/ref=jmotta, SCJP 6, OCWCD JEE5, OCE EJB JEE6
Ownership is determined by usage of the "mappedBy" attribute.
If you use the mappedBy, it means the other side of the relationship owns the relationship, and will define the foreign key or join table.
For example in a ManyToMany one side will own the relationship and the other will use mappedBy. The name of the join table will be defined by the owning side, i.e. its name will come first, i.e. if Employee owned the relationship to Project, the table would be "EMP_PROJ" not "PROJ_EMP".
Or for a OneToOne, the side without the mappedBy will define the foreign key, the other side will not have a foreign key.
I do understand what ownership of a relationship works, the doubt isn't about it and thus about "the values are defaulted from the perspective of the attribute on the owning side.", sorry if I was not clear from the get-go.