nhibernate

Is there any data on NHibernate vs Fluent NHibernate startup performance?

In short, what works faster: SessionFactory precompiling XML configuration, or Fluent NHibernate providing configuration programmatically ? ...

NHibernate with Autofac within ASP.NET (MVC): ITransaction

What is the best approach to managing NHibernate transaction using Autofac within web application? My approach to session is builder.Register(c => c.Resolve<ISessionFactory>().OpenSession()) .ContainerScoped(); For ITransaction, I have found an example on Google Code, but it relies on HttpContext.Current.Error when deciding wh...

Save data through a web service using NHibernate?

We currently have an application that retrieves data from the server through a web service and populates a DataSet. Then the users of the API manipulate it through the objects which in turn change the dataset. The changes are then serialized, compressed and sent back to the server to get updated. However, I have begin using NHibernate w...

Nhibernate ICreteria relation between tables

I have two entities say Customer and Order which exist on their own and have no relationship defined in a mapping file. Now I want nhibernate to give me the result of the following query: select customer.id,customer.name from customer,order where customer.id = order.id and order.status = "Open" I tried to use a projection but when ex...

Impact on NHibernate caching for searches with results including calculated value mapped as a formula (e.g. rank)

When defining a calculated property using a formula in NHibernate, what are the implications for when the formula varies its result depending on the query restrictions, especially with regards to query caching? More specifically, consider the following simple C# class: public class Entity { public Entity() { } public virtual in...

NHibernate SaveOrUpdate, error: No persister for

I have a NHibernate mapping for a base class A class A { } class B : A { } public save(A a) { session.SaveOrUpdate(a); } Error: No persister for B As you can see B has been passed with the correct base type A, but i still get the error about the persister for type B Does NHibernate support inheritance like this... what can i do? ...

nHibernate mapping generic IDictionary

I've asked this elsewhere and not got any sensible reply I'm trying to map an IDictionary. I have this mapping: <class name="MyProject.Item, MyProject" table="Item"> <...> <map name="Properties" access="property" table="ItemProperties" lazy="false"> <key column="ItemID" /> <index column="Idx" type="int" /> <element column="Val...

Creating reports with NHibernate

I have the following entities (simplified for this example) mapped using Fluent NHibernate: public class Stock : Security { public virtual string TickerName { get; set; } public override string GetName() { return TickerName; } } public class Fund : Security { public virtual string FullName { get; set; } public virtual string Ti...

Guidance on modelling system with Nhibernate

Hi guys, I'm having issues trying to model a new system with nhibernate or even databases. I have lot of hardware which can be connected via IP or Serial Com Port (maybe more in the future). I want to be able to have different information depending on which one it is. I was thinking of a ConnectionInformation abstract class with Seria...

Using a join in Hibernate HQL update query

string query = "update User u set u.PointsTotal = 1 join u.Rounds r where r.RoundId = :round and (r.Row1 & :val) > 0"; NHibernateSession.CreateQuery(query) .SetByte("val", (byte)val) .SetInt32("round", roundId) .ExecuteUpdate(); Just gives me "The given key was not present in the dictionary." And yes, the relations works ...

session.BeginTransaction() and transaction.Commit()

Hello there, I am new to Nhibernate, so my query may seem trivial to you. We generally embed data operation code inside using (var session = sessionFactory.OpenSession()) { using (var transaction = session.BeginTransaction()) { ...Code for CRUD operations transaction.Commit(); } } Because we generally BeginTransaction/Commi...

Working with ternary associations

I have a class: class User { IDictionary<Post, DateTime> SavedPosts { get; set; } } This is saved into a Many-To-Many table association [User] -< [Saves] >- [Post] [Saves] table: ID_USER (int) ID_POST (int) SAVED_ON (DateTime) Mapping looks like this: <map name="SavedPosts" table="[SAVES]"> <key column="ID_USER" /> <index...

Fluent NHibernate - exception occurred during configuration of persistence layer

Hello there, I am using Fluent NHibernate with an external 'hibernate.cfg.xml' file. Following is the configuration code where I am getting error: var configuration = new Configuration(); configuration.Configure(); _sessionFactory = Fluently.Configure(configuration) .Mappings(m => m.FluentMappings...

nhibernate recursive bi-directional many to many association

I Have a class Group like this: public class Group { public int GroupId{get;set;} public string GroupName{get;set;} public IList ParentGroups{get;set;} public IList ChildGroups{get;set;} } I want to generate NHibernate mapping for this and generate schema so that there is a group table and a group association table. Is this possib...

Did somebody tried to recompile NHibernate for .NET 4.0 Beta 2?

Did somebody tried to recompile NHibernate for .NET 4.0 Beta 2? ...

nHibernate order by N with SQL Server

With a SQL Query I can order by N, where N is a column index. For example SELECT name, salary FROM employee ORDER BY 2; How can I do this with nHibernate? ...

Summer of Nhibernate Session 01, why am I getting NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException?

I'm completely new to NHibernate, following along on the screencast at www.summerofnhibernate.com, which is awesome. Towards the end of the presentation, the unit test is supposed to pass, but for me it says: NHibernate.Bytecode.ProxyFactoryFactoryNotConfiguredException: The ProxyFactoryFactory was not configured. What am I doing wro...

SharedCache vs Memcached For NHibernate With ASP.NET MVC

Hi, Which shared cache provider should i use for my asp.net mvc working with NHibernate ? ShardCache NHibernate Provider Memcached NHibernate Provider Thanks. ...

Automatic CRUD forms generation for .net Windows Forms Applications

Hi, My question is about nHibernate, or any other ORM for .net that can do what I am looking for : for my web developements, I use Django Framework; the admin pages are automatically generated, so that you can do the CRUD operations through a GUI -- web interface -- right after having created your model. I wonder if nHibernate (or any ...

nHibernate one-to-many mapping question

Hello folks, I am getting this exception when mapping one-to-many relation. my mapping xml looks like this: <set name="-----" generic="true" inverse="true" cascade="all" lazy="false"> <key column="Id" /> <one-to-many class="-----------,---------" /> </set> And, <many-to-one name="------" column="Id" not-null="true" cla...