Joined: Mon Dec 21, 2009 8:12 am Posts: 3
|
Hi Guys, I am new to Hibernate and i am given some complex instruction to write. I have one table say(pract) with two columns. Both this columns for composite keys. One of the key references to 1 table and other references to table 2 i.e prac's one column is in one to many relationship with table 1 and column 2 with table 2
After some research i found out that we cannot generate pojo or corresponding xml for such type of tables like prac. or atleast eclipse dosent builds it.
I want to insert the value in prac. in both the columns. How can i do it. I can do it for the tables with pojo but i have no clue how can it be done for prac in this case.
below is the sniplet of the xml that references the table prac MyPlayList.xml entry is below
<set name="songDetailses" inverse="false" lazy="true" table="playlist_details" fetch= "select" > <key> <column name="playlist_id" not-null="true" /> </key> <many-to-many entity-name="com.flotogo.portal.hibernate.domain.SongDetails"> <column name="song_id" not-null="true" /> </many-to-many> </set>
Song details.xml entry is below <set name="myPlaylists" inverse="true" lazy="true" table="playlist_details" fetch="select"> <key> <column name="song_id" not-null="true" /> </key> <many-to-many entity-name="com.flotogo.portal.hibernate.domain.MyPlaylist"> <column name="playlist_id" not-null="true" /> </many-to-many> </set>
primary keys in the above tables are playlist_id and song_id this both keys work as composite key for the table playlist_details and i want to insert the record in playlist_details
Any help will be highly appreciated; I want to deliver it as soon as possible and we are not allowed to take help of any colleagues please help
Thanks in advance Aavin
|
|