Monday, September 3, 2007

Hibernate: Association Mappings in Annotation (JPA style)

Unidirectional Association

Unidirectional Association with Join Table

Bidirectional Association

Bidirectional Association with Join Table

(*) hibernate document chapter

Reference:
- hibernate documentation
- EJB 3.0 Spec


16 comments:

Anonymous said...

This blog has helped me a lot with my Hibernate experience. You have much better examples than the Hibernate documentation I have read..!

nada said...

I agree. Thanks a lot for the very nice samples.

Anonymous said...

Very nice summary and easy snapshot of the complex assosiate mappings in hibernate. It made me understand easily. Thanks for sharing.

The Third Rook said...

Wow, real world examples with no foo-bar!

Thanks.

Unknown said...

Thank you so much for making this!

Anonymous said...

Nice one. I am new to Jpa and Hibernate. Can any one pls guide me ?
I have Table A with 3 FKs mapped to say B,C,D tables. How can I use annotation in this case.

Unknown said...

I can't ready this very good entry without comments.

So, I would like to say thanks.

It really is an reference and helped me a lot.

dotbart said...

Thanks! Was looking for a @OneToOne unidirectional mapping!

Anonymous said...

Thank you very much!

Alfonso said...

I would like a lot if ALL java documentation is like this! thanks a lot, very usefull

Atif-Mehmood said...

Excellent, Superb, Nice
These annotations cant explain more simple than this.

Great Job

Goofy said...

hibernate config (автоматическое создание таблиц) http://blog.malphas.ru/index.php/archives/87 Интересный ресурс. Есть инфа по hibernate. Также много и другого интересного.

Anonymous said...

I love this :)

Anonymous said...

it is very helpful....thanks


Raghu

Anonymous said...

This is the best description of JPA associations on the internet! Thank you!

Innovapath said...

Excellent Post. Also Visit http://msnetframework.com/#mono.php