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: NHibernate.InvalidProxyTypeException
PostPosted: Fri Sep 07, 2007 3:40 am 
Beginner
Beginner

Joined: Thu Oct 26, 2006 4:45 am
Posts: 39
Hi,

Just to let the developers of NHibernate know:

When upgrading from NHibernate 1.0.4 to 1.20GA we got alot of InvalidProxyTypeExceptions.

This is because all mapped properties must have the 'virtual' keyword.

However, because we are working on such a large project, all the mapped properties where in chaotic order.

I download the source-code of NHibernate and added the following lines in NHibernate.InvalidProxyTypeException.

Can someone developer integrate this as enhancement in JIRA?


Code:
public class InvalidProxyTypeException : MappingException
....
      private static string FormatMessage(ICollection errors)
      {
         StringBuilder result = new StringBuilder("The following types may not be used as proxies:");
+          ArrayList sortItFirst = new ArrayList();
+          sortItFirst.AddRange(errors);
+          sortItFirst.Sort();
+          errors = sortItFirst;
            foreach (string error in errors)
         {
            result.Append('\n').Append(error);


For our upgrade, this was really helpfull so others might benefit from this as well.

Thanks,


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.