Hi all,
I'm new to Hibernate and I bumped into a problem.
I have a table that holds string data. Other tables use this table to store large string data and they hold only the corresponding ID of their entry in Strings table.
For example:
Strings table:
ID int PK,
DATA varchar(4000)
OtherTable table:
ID int PK,
NAME varchar(50),
ID_DATA int
ID_DATA is the ID of the corresponding entry in Strings table - foreign key.
I have a hard time getting this kind of association to work, there are more tables like OtherTable that use Strings table for string storage.
Basically I want the OtherTable corresponding class to have something like get/setDescription, cascade delete its entry from Strings when it is deleted.
I can't use one-to-one cause the PKs are different.
Can someone point me in the right direction?
Thanks in advance,
soso
|