This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
There's a few issues with using HiLo, that I think the designer should take care of (since I think the designer is to speed things up, not slow them down) The HiLo table isn't generated when it's in use for the Identity. (this is because you generate your own tables rather than let NHibernate do it) That's the biggest issue, you really need to have prior knowledge of HiLo in order to get it working from the Designer, otherwise it doesn't work out of the box :( Also the defaults that are generated for the HiLo aren't optimal, I think if HiLo is selected from the Wizard then it should ask a few questions which generate defaults for each entity. ------ The Lo should have a default value (either 10 or 100 IMO) If a Lo is present and you configure the session factory to generate the schema: _sessionFactory = Fluently.Configure() .Database(FluentNHibernate.Cfg.Db.MsSqlConfiguration.MsSql2008.ConnectionString("")) .Mappings(m => m.FluentMappings.AddFromAssembly(typeof(Entity1).Assembly)) .ExposeConfiguration(x => new SchemaUpdate(x).Execute(false, true)) .BuildSessionFactory(); So I've added SchemaUpdate() With no Table or Column defined, it generates a generic table for HiLo, the problem with this, is this is where ALL Hi values come from, for all entities. So if you have Entity1, and Entity2, you insert into both Entity1 and 2, NHibernate selects the Hi for each individual entity type, and you end up with: -- statement #1 I think you need to setup Row per Table http://www.philliphaydon.com/2010/10/using-hilo-with-fluentnhibernate/
|
|