-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Help needed: Mapping a collection from a null property
PostPosted: Tue Apr 19, 2005 5:33 am 
Newbie

Joined: Wed Jan 05, 2005 6:54 am
Posts: 15
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 19, 2005 9:02 am 
Newbie

Joined: Wed Jan 05, 2005 6:54 am
Posts: 15
I decided to manage this issue now via additional configuration tables.

Thanks anyway.

Pvblivs


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.