-->
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 against a interface
PostPosted: Sat Sep 03, 2005 3:16 am 
Beginner
Beginner

Joined: Thu May 12, 2005 2:14 am
Posts: 33
Location: Sweden, Sk
Hi

I have two classes and they both implements IAdministrator. I'm trying to map against this interfaces but i ends up with a "NHibernate.MappingException: Unknown entity class: Client1.BLL.Administrator" message"

In this case I have 2 different types of objects, Client1.BLL.Administrator and Client2.BLL.Administrator. To make sure I instansiate the correct type im using a factory which is called from IInterceptor.Instantiate method. It returns the correct type, in this case Client1.BLL.Admi.. And that class does implements the correct interface IAdministrator. The reason I have choosed this approach is that different clients will have different business rules, eg. length of password, so I need two types of objects.

I could have more than one mapping file, one for each object type but then I get problems in my repositories when I shall write the queries.

eg.
from Client?.BLL.Admin.. where ..


I used a subclass instead. Works as it should now.. almost :)


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.