Hi,
thank u for ur favourable reply.
I don't know my hbm file declarations are correct. But the table structure is correct. I have not decalred any property for application_id in Submission.hbm.xml file.But I have given <set> tag in application.hbm file and <many-to-one> tag element in submission table. In submission.java bean file , I have created Application object setter and getter methods.
But I need to insert record into submission table without insert into application table.Also I need to fetch application details of a particular submission. application_id
Is there any solution? If so, Please send me the code and hbm fle proper declarations.
Thanks and regards,
Sreekanth.
aphawkes wrote:
Let me see if I get this right....
You have a foreign key from the submission table to the application table. You're asking how to insert into the submission table withouth inserting into the application table.
How is the submission.application_id field supposed to be populated? You have stated that it cannot be null and that any value in this field must exist in the application_id field in the application table.
I think you need to re-think what you're saying. You should be able to "pretend" to be Hibernate. It's only SQLs, right? In this situation, how would you insert into the submission table using a SQL? If that can be explained, then you might be closer to an answer here.