-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problems with hbm2net 1.0.2.0 (Solved!?)
PostPosted: Fri Mar 17, 2006 7:10 am 
Newbie

Joined: Wed Feb 15, 2006 3:26 pm
Posts: 5
Hello I'm using hbm2net found in Nhibernate Contribute 1.0.2.0 and got a big problem.

In my mapping files I'm using something like

Code:
<class name="namespace.classname, assemblyname">


and hbm2net generates files with the filename "classname, assemblyname.cs" with a namespace of "namespace" and a class name of "classname, assemblyname".

I know there are already topics about this found in this forum but no current ones and I don't want to use an old version of hbm2net.

Isn't there a solution for this problem? Do I do something wrong?


EDIT:

I took a look at the code and I guess I found the reason for this problem.

In the Method initFullyQualifiedName (ClassName.cs) I added some code to check if the namespace is specied in the "name" attribute. Take a look:

Code:
      private void  initFullyQualifiedName(string fqn)
      {
         this.fullyQualifiedName = fqn;
         if (fullyQualifiedName.IndexOf(",")>0)
            fullyQualifiedName = fullyQualifiedName.Substring(0,fullyQualifiedName.IndexOf(","));
         if (!Primitive)
         {
            if ((Object) fqn != null)
            {
                    // begin of my code
                    int indexComma = fqn.IndexOf(",");
                    string s;

                    if (indexComma > -1)
                    {
                        s = fqn.Substring(0, indexComma);

                        if (s.IndexOf(".") > -1)
                            fqn = s;
                        else
                            fqn = fqn.Substring(indexComma + 1).Trim() + "." + s;
                    }
                    // end of my code

               int lastDot = fqn.LastIndexOf(".");
               if (lastDot < 0)
               {
                  name = fqn;
                  packageName = null;
               }
               else
               {
                  name = fqn.Substring( lastDot + 1 );
                  packageName = fqn.Substring(0, lastDot);
               }
            }
            else
            {
               name = fqn;
               packageName = null;
            }
         }
         else
         {
            name = fqn;
            packageName = null;
         }
      }


What do you think?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 17, 2006 7:12 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Please submit this to our JIRA.


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