-->
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: Do interfaces apply to NHibernate
PostPosted: Thu May 01, 2008 1:30 pm 
Beginner
Beginner

Joined: Mon Feb 04, 2008 7:36 pm
Posts: 31
I am feeling a bit challenged here.

Lets say the I have the following classes

Code:
interface IFoo
{
     string Foo{get;set;}
}

abstract class FooBase : IFoo
{
    string Foo {get;set;}
}

absract class BarBase
{
  ITItem Bar{get;set;}
}

class T1 : FooBase { }
class T2 : BarBase,  IFoo
{
  string Foo{get;set;}
}



Now, How do I persist this?

If I Put FooBase in one table and BarBase I have the problem where the BarBase.Bar can be either a FooBase or a BarBase. So, the only answer is to stick these things in the same table.

That seems a bit problematic, lets say I have 20 different interfaces to implement, do I have to stick them all in some base "entity" table? Thats the solution I am headed toward. It seems very ugly from a 3nf viewpoint.


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.