jQuery in Action, 2nd edition*
The moose likes Object Relational Mapping and the fly likes Hibernate relationl table with aditional column Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate relationl table with aditional column" Watch "Hibernate relationl table with aditional column" New topic
Author

Hibernate relationl table with aditional column

Ahasan Habib
Greenhorn

Joined: May 26, 2010
Posts: 5
Dear experts,

I am facing problem in composite-element mapping of hibernate. My expected relation is many to many in document and task. That is a task may have multiple documents and a document may have assigned to multiple task. Relational table will contain both foregin key with additional column. In attachment I have given the tables structures.

My Task hbm file:


My document hbm file:


I have created all mapping files. My question what will be the java code for inserting in TM_TASK table as well as for TM_TASKDOCS table. And what will be the TaskDocsInfo class exactly. where I have to create the composite class instance and have to assign this instance? I have tried with the following code but fails



Please help.

Thanks in advance



[Thumbnail for M2M.JPG]

Ahasan Habib
Greenhorn

Joined: May 26, 2010
Posts: 5
Please reply anyone
Ahasan Habib
Greenhorn

Joined: May 26, 2010
Posts: 5
No one here to help
Randeep Singh Arora
Greenhorn

Joined: May 14, 2010
Posts: 6
send me your code and contact me at skype rsingh008.I may be able to help you out...
Ahasan Habib
Greenhorn

Joined: May 26, 2010
Posts: 5
Hi Mr. Randeep Singh,

I have added you on skype (my id: sumon.dsl) but can not get you online. Please help.

Thanks in advance
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate relationl table with aditional column