Basically..
There are three tables
Users, Blogs and User_Blogs
User_Blogs has a composite id (userId,blogId)
here is my user_blog mapping file
Code:
<hibernate-mapping package="com.insaini.publogs.hibernate.tables">
<class name="UserBlogRating" table="user_blog_rating">
<composite-id name="id" class="UserBlogRatingKey">
<key-many-to-one name="blogid" column="blogId" />
<key-many-to-one name="userid" column="userId" />
</composite-id>
<property name="rating" column="rating" type="integer" not-null="true" />
</class>
</hibernate-mapping>
my blog mapping file is above..
there is a many to many relationship between blogs and users so obviously there is a one-to-many relationship between users and user_blogs and one-to-many relationship between blogs and user_blogs
how exactly do i setup the relationships in these mapping files?
thanks
jazz