Hi,
I am using Hibernate version:3.0 and Annotations for the same. I am using MySQL database.
I am very new to Hibernate and have the following requirement -
Table ERROR_INFORMATION
long ERROR_ID(PK)
-----------------------------------
Table FILE_INFORMATION
long ERROR_ID
I have model classes errorInformation.java and fileInformation.java mapped to these two tables.
Now I want to specify in model class fileInformation that errorId in table File_Information actually refers to errorId in ERROR_INFORMATION table.
I want to specify some annotation that tells that ERROR_ID in ERROR_INFORMATION is a foreign key for FILE_INFORMATION.
Is it possible?
I have a similar requirement for composite key.
I have tried with @joinColumn and @joinTable but that did not work for me.
Please let me know where I can refer to get information on these.
Thanks,
Manu
|