I have a three tables:
Domain
|Field |Type |
| id | BIGINT |
| domain | VARVHAR(45) |
| other | ... |
Url
|Field |Type |
| id | BIGINT |
| domain_id | BIGINT |
| url | VARCHAR(45) |
| other | ... |
Data
|Field |Type |
| id | BIGINT |
| type | ENUM('DOMAIN','URL') |
| entity_id | BIGINT |
| data | ... |
Under other fields, witch contains in Domain and Url tables I understand the some fields, whitch different between themselves by types.
Field entity_id in the Data table must contain the ID from the table Domain or Url depending on value of type fields in the Data table.
How I can create this xml mapping for Hibernate use?