-->
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.  [ 4 posts ] 
Author Message
 Post subject: Interface mapping
PostPosted: Thu Mar 02, 2006 12:14 pm 
Newbie

Joined: Thu Mar 02, 2006 11:45 am
Posts: 5
Hi,

We are planning to use NHibernate in our persistence layer for the next version of our application. We have created a prototype to persiste our existing model to a RDBMS and we found a problem. Our model has some interfaces that we need to map to existing tables and we could not find how to do it with NHibernate.

We found that the interface mapping can be done in Hibernate (java) using an Interceptor and returning the interface name in the "getEntityName" method (see: http://www.hibernate.org/339.html) when trying to persist or load a concrete interface implementation.

As we look further we found that NHibernate does not support (as of 1.0.2) "Entity Name" in the class definition nor it has such a method in the Interceptor definition.

Is there any plan to support these features?

How difficult is to implement?

Is there any other solution?

Thanks,
Rogelio J. Baucells


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 02, 2006 4:30 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
It's already entered in JIRA as NH-543 (http://jira.nhibernate.org/browse/NH-543). I'll look at it once I'm done with porting stored procedures support.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 03, 2006 3:02 pm 
Newbie

Joined: Thu Mar 02, 2006 11:45 am
Posts: 5
Thanks for the information Sergey. I worked on a similar solution yesterday but I will go for the one in the patches.

Is there any plans to include that in the next release?

Thanks,

RJB


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 06, 2006 10:34 am 
Newbie

Joined: Thu Mar 02, 2006 11:45 am
Posts: 5
Sergey,

I got the latest version from SVN and applied the patches available in NH-543. While looking at the details of those patches I noticed the "GetEntityName" method from the interceptor is only used by the SessionFactoryImpl class, it is not been used by the SessionImpl at the time of looking for the Entity Name. I think this should be extended to use the Entity Name provided by the Interceptor at the Session level.

What do you think?

In what order the lookup should be done? (SessionFactory, Session or the other way)

I can work on this and send you a patch, just let me know.

Thanks,

RJB


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.