disable the keywords auto-import or try to fix the schema-metadata implementation http://fabiomaulo.blogspot.com/2009/06/auto-quote-tablecolumn-names.html <http://fabiomaulo.blogspot.com/2009/06/auto-quote-tablecolumn-names.html> http://fabiomaulo.blogspot.com/2009/06/from-where-start-to-implements.html
2009/7/20 William Chang <[email protected]> > > I'm getting an exception from my simple NUnit test, creating a user: > System.ArgumentException : Column 'Reserved Word' does not belong to > table ReservedWords. > > I don't think I'm using any reserve words in my simple "Users" table. > Maybe, it could be happening on my side or NHibernate? Please help? Is > there a workaround or a solution? > > For your information, it was working during NHibernate, beta release. > > Specs: > Microsoft ASPNET 3.5 > MySQL 5.0.24a > MySQL Connector/Net 6.0.4 > NHibernate 2.1.0GA > Castle ActiveRecord 2.0 Beta1 > > Stack Trace: > at System.Data.DataRow.GetDataColumn(String columnName) > at System.Data.DataRow.get_Item(String columnName) > at NHibernate.Dialect.Schema.MySQLDataBaseSchema.GetReservedWords() > at NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.GetReservedWords > (Dialect dialect, IConnectionHelper connectionHelper) > at NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.Update > (ISessionFactory sessionFactory) > at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg, > IMapping mapping, Settings settings, EventListeners listeners) > at NHibernate.Cfg.Configuration.BuildSessionFactory() > at Castle.ActiveRecord.Framework.SessionFactoryHolder.GetSessionFactory > (Type type) > at > Castle.ActiveRecord.Framework.SessionFactoryHolder.CreateScopeSession > (Type type) > at Castle.ActiveRecord.Framework.SessionFactoryHolder.CreateSession > (Type type) > at Castle.ActiveRecord.ActiveRecordBase.InternalCreate(Object > instance, Boolean flush) > at Castle.ActiveRecord.ActiveRecordBase.Create() > at Vendorsoft.Data.Tests.ModelsTests.createUser() in C:\Documents > \Visual Studio 2008\Projects\Vendorsoft\Data.Tests\ModelsTests.cs:line > 22 > at Vendorsoft.Data.Tests.ModelsTests.User() in C:\Documents\Visual > Studio 2008\Projects\Vendorsoft\Data.Tests\ModelsTests.cs:line 29 > > Source Code: > protected Data.Models.User createUser() { > Data.Models.User obj1; > obj1 = new Vendorsoft.Data.Models.User { > userAlias = "diehard", > userNameFirst = "William", > userNameLast = "Chang", > userEmail = "[email protected]", > userDateCreated = DateTime.Now > }; > obj1.Create(); > > return obj1; > } > > create table Users ( > userId VARCHAR(40) not null, > userAlias VARCHAR(64) not null, > userNameFirst VARCHAR(64) not null, > userNameLast VARCHAR(64) not null, > userEmail TEXT not null, > userDateCreated DATETIME not null, > userIsDeleted TINYINT(1) default 0 not null, > primary key (userId) > ) > > Sincerely, > Will > > > > -- Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
