I have 2 simple tables in database. They look like:
T1 T2
ID NUMBER Primary key ID NUMBER Primary key & Foreign key from T1
Value VARCHAR Value VARCHAR
How does hibernate entity for T2 look like? I tried to do it with @Embeddable class containing T1 mapped-class object but this doesn't work. Thanks.
UPD: the full use case when I need such a structure is below: I have business entities tables, containing some data for specific business users, and Company table with Id and value fields too, and I want to create CompanyToBEntity table, containing data about what company can access what object.(objects are any row of bus.entities).
So I think this structure fits this case.
pic describing it better: