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.  [ 1 post ] 
Author Message
 Post subject: Mapping untyped member of a class
PostPosted: Mon Sep 01, 2008 11:35 am 
Newbie

Joined: Mon Sep 01, 2008 11:07 am
Posts: 3
Location: Israel
Hi all. I'm a newbie to NHibernate.

I have a wrapper class, which is used to add metadata to the object it holds:
Code:
public class Data
{
    public DateTime Time {get;set;}
    public string Hostname {get;set;}
    ...
    pubilc object ObjectData {get;set;}
}


There are several objects that can be stored in the ObjectData property.
Assuming that:
    * each such an object should be O/R mapped, and
    * the ideal database structure would be a table for each such internal object, that also include the wrapper class fields

What would be the best way to define the mapping?

(just to make things more simple and clear - I want to add meta data to simple, mapped objects. The metadata should be stored in another class, which happens to also include the stored class itself. In the DB, the metadata is ideally stored WITH the class table itself, and not in a table of its own, connected with a foreign key, but if it isn't possible - how can I define a foreign key that does not point to a specific class?)

Itai.


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

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.