This week's book giveaway is in the OCP forum.
We're giving away four copies of OCP Java SE 8 Programmer II Exam Study Guide and have Kathy Sierra, Bert Bates, & Elizabeth Robson on-line!
See this thread for details.
Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate tips: inner table  RSS feed

 
Ranch Hand
Posts: 324
Eclipse IDE Firefox Browser Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when there is a many to many relationship we know will be a physical table to resolve it, however we may remive one of the entity table to gain performance. Is it possible to do a similar hack with Hibernate ?
 
German Gonzalez-Morris
Ranch Hand
Posts: 324
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I meant "Associative Table"
 
Saloon Keeper
Posts: 19266
85
Android Eclipse IDE Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate isn't magic. If you want a many-to-many association, you do need an association table. If you do not explicitly map one, Hibernate will construct and use one itself. If it does, it will synthesize the name of the table and the linking (foreign key) fields according to well-defined rules as given in the Hibernate documentation.

Needless to say, you generally don't want to eager-fetch everything on a many/many relationship.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!