1.2.0 GA
<?xml version="1.0" encoding="utf-8" ?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"> <class name="BLL.General.UserArtist, BLL" table="UserArtist"> <composite-id name="Id"> <key-property name="UserID"/> <key-property name="ArtistID"/> </composite-id> <property name="UserArtistRank" type="Int32"> <column name="UserArtistRank" length="4" sql-type="int" not-null="true"/> </property> <property name="UserArtistRating" type="Double"> <column name="UserArtistRating" length="8" sql-type="float" not-null="true"/> </property> <property name="UserArtistCreatedBy" type="String"> <column name="UserArtistCreatedBy" length="50" sql-type="nvarchar" not-null="true"/> </property> <property name="UserArtistCreatedAt" type="DateTime"> <column name="UserArtistCreatedAt" length="8" sql-type="datetime" not-null="true"/> </property> <many-to-one name="User" class="BLL.Security.User, BLL"> <column name="UserID" length="16" sql-type="uniqueidentifier" not-null="true" index="PK_UserArtist"/> </many-to-one> <many-to-one name="Artist" class="BLL.General.Artist, BLL"> <column name="ArtistID" length="16" sql-type="uniqueidentifier" not-null="true" index="PK_UserArtist"/> </many-to-one> </class> </hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
at NHibernate.Cfg.Configuration.LogAndThrow(MappingException me) at NHibernate.Cfg.Configuration.AddValidatedDocument(XmlDocument doc, String name) at NHibernate.Cfg.Configuration.AddXmlReader(XmlTextReader hbmReader, String name) at NHibernate.Cfg.Configuration.AddInputStream(Stream xmlInputStream, String name) at NHibernate.Cfg.Configuration.AddResource(String path, Assembly assembly) at NHibernate.Cfg.Configuration.AddResources(Assembly assembly, IList resources, Boolean skipOrdering) at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly, Boolean skipOrdering) at NHibernate.Cfg.Configuration.AddAssembly(Assembly assembly) at NHibernate.Cfg.Configuration.AddAssembly(String assemblyName) at NHibernate.Cfg.Configuration.DoConfigure(XmlDocument doc) at NHibernate.Cfg.Configuration.Configure(XmlTextReader reader) at NHibernate.Cfg.Configuration.Configure(XmlNode node) at NHibernate.Cfg.Configuration.Configure() at Blog_Default.loadBlog() in c:\Development\TMS\Portal\Blog\Default.aspx.cs:line 86 at Blog_Default.Page_Load(Object sender, EventArgs e) in c:\Development\TMS\Portal\Blog\Default.aspx.cs:line 37 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
mssql2005
I've attempted to use codesmith to generate the classes and mapping files as I hoped it would help me to understand a little better, and get something working. I've found that so far codesmith has produced mappings and classes that have quite numerous problems. I have also noticed that it is using mapping-2.0 and not 2.2.
My first question is are there new templates for codesmith that do a better job? and second, if not. what do i have to do to get many-to-many relationships working. I seem to be lacking alot in that area.
Thanks much!
|