-->
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.  [ 7 posts ] 
Author Message
 Post subject: using <Any> mapping WITHOUT FullyQualifiedName
PostPosted: Mon Nov 21, 2005 10:12 am 
Regular
Regular

Joined: Thu May 12, 2005 10:12 am
Posts: 71
Location: Buenos Aires, Argentina
Hi, I'm using the <Any> mapping in my project and I just realized that the information that get inserted in the DB is the fully qualified name of the class.

This is a big problem with version updates. If I upgrade my software version I will have to update every row with the new version number. Is there a way NOT to use the FullyQualifiedName?? Should I rise a jira issue? This is kind of urgent for me since we are scheduled to deploy the application in january.

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 21, 2005 11:13 am 
Senior
Senior

Joined: Thu Jun 02, 2005 5:03 pm
Posts: 135
Location: Paris
Hey roniburd,

See the posts I made on this subject:
http://nhibernate.sourceforge.net/forum/viewtopic.php?t=1093
http://nhibernate.sourceforge.net/forum/viewtopic.php?t=1101&highlight=manytoany

I would have preferred to find a way where I didn't have to explicitly specifiy the descriminators, and got an answer I couldn't understand on the JIRA issue I raised about it after the second thread. At the end of the day I was forced to use the meta-value tag to specify a discriminator.

Hope this helps,

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 21, 2005 11:46 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
What Peter meant in that comment is that you should specify a fixed version for your domain assembly.

Here is another solution you can try. The piece of code that writes assembly-qualified type names to the database is TypeType.NullSafeSet. You can try deriving your own type from TypeType, overriding its NullSafeSet and NullSafeGet operations and specifying your new type as the meta-type for the <any> tag.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 21, 2005 12:13 pm 
Regular
Regular

Joined: Thu May 12, 2005 10:12 am
Posts: 71
Location: Buenos Aires, Argentina
Thanks you both...

Sergey, forcing a version freeze on my domain isn't a bit extreme? I understand I could build my own type, but that seems a bit overkill just for droping the fully qualified name.

After all .NET can (AFAIK) instantiate by reflection without using the fully qualified name given an assembly. Could this feature be added?

What are other people doing??


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 21, 2005 12:22 pm 
Senior
Senior

Joined: Thu Jun 02, 2005 5:03 pm
Posts: 135
Location: Paris
I think what Peter was getting at is not actually doing a version freeze, but setting something in the assembly to force it to report a specific version all the time rather than the version that would normally be added to a build.

He gave me a couple of URLs to get information from but I didn't have the time to dig into it in any detail, so I walked away. If you want to read about it you can have a look at the JIRA issue I reported and Peter's response here: http://jira.nhibernate.org/browse/NH-422

If you figure it out let me know!

Cheers,

Symon.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 21, 2005 12:40 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
roniburd wrote:
I understand I could build my own type, but that seems a bit overkill just for droping the fully qualified name.


Why is it overkill? As I said, it only means overriding two methods (maybe only one). Writing your own types is one of the means of customizing NHibernate. Alternatively you can create a JIRA issue and have a vote there for it to be changed in the next major/minor version (probably 1.1). I personally don't want to change this in the 1.0.x line.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Dec 30, 2005 11:03 am 
Expert
Expert

Joined: Tue Aug 23, 2005 5:52 am
Posts: 335
It's been a while since I looked at this and I'm wondering whether anyone out there can explain how Peter intended that a fixed (non-running) version be specified for a domain assembly. Is there a way for the version to be set specifically so that it will only affect the type names as they are persisted?

I've re-read the links Peter supplied, but they seem to have more to do with remoting and I can't figure out how they apply to this problem.

Can anyone help clarify this?

Cheers,

Symon.


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