Hi,
I have an issue regarding hibernate2.
Involved are two entity types "Category" and "FieldTitle" and a mapping table namend "CATEGORY_FIELD_TITLE". Category is a one-to-many-hierarchy-Structure (a Category can have child Categories etc.)
To any Category several FieldTitles are assignable to configure, what fields are available in the child Categories (to put information in).
That means: What fields you can fill out is specified in the parent Category via a collection mapping to FieldTitle.
So far, with Hibernate , everything works fine.
My issue:
I want to dynamically specify default FieldTitles like "name" and "description" that have to be filled out in every Category.
My database solution would be simply to set CATEGORY_FIELD_TITLE.CATEGORY_ID to NULL.
But how can I map a collection to an Entity when the foreign key is null with Hibernate ? How do I inform Hibernate about such a mapping condition?
Can someone help, please?
Regards,
Pvblivs
|