user3397694
user3397694

Reputation: 121

directional and non-directional associations

I am reading a book Hibernate in action. In this book there is a explanation for difference between association between classes and between tables in relational model as below.

" Object references are inherently directional; the association is from one object to the other. If an association between objects should be navigable in both directions, you must define the association twice, once in each of the associated classes. Foreign key associations aren't by nature directional. In fact, navigation has no meaning for a relational data model, because you can create arbitrary data associations with table joins and projection. "

i want to clear how associations between classes are directional and tables joins are non directional.Can anyone help me..

Upvotes: 0

Views: 511

Answers (1)

ashokhein
ashokhein

Reputation: 1058

As per my understanding ,

"if an association between objects should be navigable in both directions, you must define the association twice, once in each of the associated classes."

In Hibernate, We can traverse from one class to other class using association(one to many,many to one,one to one,etc).Without association ,We can't join to classes (two tables).So we need to define in each classes for association which is called bi-direction.

In physical tables are no need to join each others.But we can join logically in hibernate class.

Upvotes: 1

Related Questions