class Idea {
Collection
Collection
}
class Proposal {
Collection
Collection
}
Mapped to:
CREATE TABLE (
IDEA_ID VARCHAR(36), /* Foreign key */
PROPOSAL_ID VARCHAR(36), /* Alternate key */
TAG VARCHAR(100), /* Whatever was in the String */
TAG_TYPE VARCHAR(9) /* 'PRIMARY' or 'SECONDARY' */
);
I'm thinking.. no. My problem is that I can't see a way to get Hibernate to take care of the TAG_TYPE column - a value that exists in the database, and must be inserted whenever new rows are inserted, but has a value specific to the domain collection whence it came.
Hibernate supports computed properties, but those exist on the domain side, and not in the database. I want the opposite! :-)