-->
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: Possible bug in hbm2net
PostPosted: Fri Apr 14, 2006 5:57 pm 
Newbie

Joined: Fri Apr 14, 2006 5:42 pm
Posts: 1
Hello:

I was trying to use hbm2net to generate the code for some mapping files that have the class name in the form:

namespace.class, assembly

The generated files was having incorrect namespace and was ssaved in an incorrect path, i think the problem could be in the initFullyQualifiedName method of the NHibernate.Tool.hbm2net.ClassName class, i think it should look like this:

Code:
      
private void  initFullyQualifiedName(string fqn)
{
   this.fullyQualifiedName = fqn;
   
    if (fullyQualifiedName.IndexOf(",") > 0)
    {
        fullyQualifiedName = fullyQualifiedName.Substring(0, fullyQualifiedName.IndexOf(","));
    }
   
    if (!Primitive)
    {
      if ((Object) fullyQualifiedName != null)
      {
            int lastDot = fullyQualifiedName.LastIndexOf(".");
         if (lastDot < 0)
         {
            name = fullyQualifiedName;
            packageName = null;
         }
         else
         {
                name = fullyQualifiedName.Substring(lastDot + 1);
                packageName = fullyQualifiedName.Substring(0, lastDot);
         }
      }
      else
      {
            name = fullyQualifiedName;
         packageName = null;
      }
   }
   else
   {
        name = fullyQualifiedName;
      packageName = null;
   }
}



With that the code looks as being generated correctly, but, please let me know if it's correct or not :)


( Note: i'm building using .net 2.0 )


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.