• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

One to Many relationship

 
Trilochan Bharadwaj
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two tables:

MEDIA(ID, NAME, TYPE)
MEDIA_TYPE(ID, NAME, CODE, MEDIA_ID)

I want to write a critieria query with following association

Media.getMediaTypes( ) ( where Media types is the collection), now the problem is my hibernate mapping files generate Media Type with many-to-one relationship with media but media has no reference to media types; how do i make this go bothways, with hibernate mapping media type collection inside media table...?

Tri
 
Rishi Shehrawat
Ranch Hand
Posts: 218
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have to modify the Media hbm & add Media types for you to be able to do this
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic