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?