I am getting the following error when calling cfg.addassembly:
could not interpret type: organization
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: NHibernate.MappingException: could not interpret type: organization
Source Error:
Line 17: {
Line 18: cfg = new Configuration();
Line 19: cfg.AddAssembly("CID.IPath.NewBusinessLayer");
Line 20:
Line 21: ISessionFactory factory = cfg.BuildSessionFactory();
Source File: c:\projects\cid\ipath\businesslayer\cid.ipath.businesslayer\db.cs Line: 19
Stack Trace:
[MappingException: could not interpret type: organization]
NHibernate.Cfg.Binder.GetTypeFromXML(XmlNode node) +139
NHibernate.Cfg.Binder.BindSimpleValue(XmlNode node, SimpleValue model, Boolean isNullable, String path, Mappings mappings) +14
NHibernate.Cfg.Binder.BindRootClass(XmlNode node, RootClass model, Mappings mappings) +866
NHibernate.Cfg.Binder.BindRoot(XmlDocument doc, Mappings model) +622
NHibernate.Cfg.Configuration.Add(XmlDocument doc) +110
NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream) +107
NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly, Boolean skipOrdering) +255
NHibernate.Cfg.Configuration.AddAssembly(String assemblyName) +181
CID.IPath.NewBusinessLayer.Db..ctor() in c:\projects\cid\ipath\businesslayer\cid.ipath.businesslayer\db.cs:19
CID.IPath.NewBusinessLayer.FaxQueue.Create(String documentName, String destinationFaxNumber, String documentPath) in c:\projects\cid\ipath\businesslayer\cid.ipath.businesslayer\faxqueue.cs:296
CID_IPATH.test.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\CID_IPATH\test.aspx.vb:29
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032
======================================
The assembly.cs is:
using System;
namespace CID.IPath.NewBusinessLayer
{
///--------------------------------------------------------------------------------
///<summary>
///Persistent domain entity class representing 'organization' entities.
///</summary>
///<remarks>
///
///Mapping information:
///This class maps to the 'organization' table in the data source.
///</remarks>
///--------------------------------------------------------------------------------
public class organization
{
#region " MatsSoft maintained code : Generated Code Region "
//Private field variables
//Holds property values
private System.Int32 m_Id;
private client m_client;
private System.DateTime m_creationdate;
//Public properties
///--------------------------------------------------------------------------------
///<summary>
///Persistent primitive identity property.
///</summary>
///<remarks>
///This property is an identity property.
///The identity index for this property is '0'.
///This property accepts values of the type 'System.Int32'.
///The accessibility level for this property is 'PublicAccess'.
///The accessibility level for the field 'm_Id' that holds the value for this property is 'PrivateAccess'.
///
///Mapping information:
///The property maps to the column 'organization_id' in the data source.
///</remarks>
///--------------------------------------------------------------------------------
public virtual System.Int32 Id
{
get
{
return m_Id;
}
}
///--------------------------------------------------------------------------------
///<summary>
///Persistent one-one reference property.
///</summary>
///<remarks>
///This property accepts references to objects of the type 'client'.
///This property is part of a 'OneToOne' relationship.
///The inverse property for this property is 'client.organization'.
///This property inherits its mapping information from its inverse property.
///The accessibility level for this property is 'PublicAccess'.
///The accessibility level for the field 'm_client' that holds the value for this property is 'PrivateAccess'.
///This property is marked as Read-Only.
///
///Mapping information:
///This class maps to the 'client' table in the data source.
///The property maps to the column 'organization_id' in the data source.
///The property maps to the identity column 'organization_id' in the data source.
///</remarks>
///--------------------------------------------------------------------------------
public virtual client client
{
get
{
return m_client;
}
set
{
m_client = value;
}
}
///--------------------------------------------------------------------------------
///<summary>
///Persistent primitive property.
///</summary>
///<remarks>
///This property accepts values of the type 'System.DateTime'.
///The accessibility level for this property is 'PublicAccess'.
///The accessibility level for the field 'm_creationdate' that holds the value for this property is 'PrivateAccess'.
///
///Mapping information:
///The property maps to the column 'creation_date' in the data source.
///</remarks>
///--------------------------------------------------------------------------------
public virtual System.DateTime creationdate
{
get
{
return m_creationdate;
}
set
{
m_creationdate = value;
}
}
#endregion //MatsSoft maintained code : Generated Code Region
#region " MatsSoft maintained code : Custom Code Region "
//Add your custom code here:
#endregion //MatsSoft maintained code : Custom Code Region
}
}
==================================
The assembly.hbm.xml is:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" schema="dbo">
<class name="CID.IPath.NewBusinessLayer.organization, CID.IPath.NewBusinessLayer" table="organization">
<id name="Id" type="Int32" column="organization_id">
<generator class="identity" />
</id>
<one-to-one name="client" class="CID.IPath.NewBusinessLayer.client, CID.IPath.NewBusinessLayer" />
<property name="creationdate" column="creation_date" type="DateTime" />
</class>
</hibernate-mapping>
|