Questions tagged [fluent-nhibernate]

Fluent NHibernate lets you write NHibernate mappings in strongly typed C# code. This allows for easy refactoring, improved readability and more concise code.

Fluent NHibernate offers an alternative to NHibernate's standard XML mapping files. Rather than writing XML documents (.hbm.xml files), Fluent NHibernate lets you write mappings in strongly typed C# code. This allows for easy refactoring, improved readability and more concise code.

Installation Fluent NHibernate can most easily be installed through its NuGet package.

Install-Package FluentNHibernate

Resources

5486 questions
2
votes
1 answer

NHibernate Search Lucene.NET SearchFactory is null

I've been struggling with the following issue for hours now. I tried this with different NHibernate/NHibernate.Search assemblies (3.0.0.4 / 2.1.2), all of them result in the same error. Used Lucene version is 2.9.2.2 All of them compiled from…
2
votes
0 answers

fluent nhibernate , many to many, no lazy, circular reference

I have two class: Role and User with a ManyToMany relation and I maped them like this : Role HasManyToMany(r => r.Users) .Table("CFG_User_Role") .ParentKeyColumn("RoleId") .ChildKeyColumn("UserId") …
Julien
  • 833
  • 8
  • 20
2
votes
1 answer

Persisting simple tree with (Fluent-)NHibernate leads to System.InvalidCastException

there seems to be a problem with recursive data structures and (Fluent-)NHibernate or its just me, being a complete moron... here's the tree: public class SimpleNode { public SimpleNode () { this.Children = new List (); } public…
fudge
  • 121
  • 1
  • 5
2
votes
1 answer

Fluent NNhibernate Exception when running MSTest from commandline

I'm writing some unit tests for Fluent NHibernate mappings (for the first time). When run in visual studio they run perfectly fine. This is using Resharpers Unit Test window or the built in Visual Studio one. The problem is when the unit tests are…
Phill
  • 18,398
  • 7
  • 62
  • 102
2
votes
0 answers

Pivot in FluentNhibernate

I have a table structure as follows: CREATE TABLE MessageParameters ( SequenceId int IDENTITY(1,1) NOT NULL, MessageQueueId int NOT NULL, ParameterName varchar(50) …
Josh
  • 16,286
  • 25
  • 113
  • 158
2
votes
2 answers

Timeout SqlException when using IsolationLevel.ReadUncommitted

I'm trying to write an integration test that tests my FluentNHibernate mapping configuration. The basic idea of the test is to insert some data, then read it back, and ensure the inserted data matches the data read back. I don't want to add test…
Ronan Moriarty
  • 526
  • 4
  • 18
2
votes
2 answers

Unit Testing Fluent NHibernate. Need help understanding an exception that occurs during a test

I have the following test support classes. public class FixtureBase { protected SessionSource SessionSource { get; set; } protected ISession Session { get; private set; } [TestFixtureSetUp] public void…
2
votes
1 answer

Fluent NHibernate: Many to Many mapping on a single table

I have a Table of Companies, and I'm trying to build a matrix of competitors between them. For example: McDonalds is a Competitor of Wendy's, and vice-versa. Here's the mappings I've tried: HasManyToMany(x =>…
Ryan Ternier
  • 8,714
  • 4
  • 46
  • 69
2
votes
0 answers

nhibernate automapping with union-subclass option

I want to (auto)map a base class and its derived class to two different tables, as described here by ayende (unioned subclasses). however, according to fluent nHibernate's documentation, I don't see a way do do that. the property in…
J. Ed
  • 6,692
  • 4
  • 39
  • 55
2
votes
1 answer

Auto Increment (Identity) does not work in Fluent NHibernate

I'm using Fluent Nhibernate. Mapping class looks following: public class CategoryMap : ClassMap { public CategoryMap() { Id(x => x.CategoryId).UniqueKey("CategoryId").GeneratedBy.Increment(); Map(x =>…
user6408649
  • 1,227
  • 3
  • 16
  • 40
2
votes
2 answers

Exception on mapping On-To-Many in one table. Could not find property nor field X in class Y

I try to create a tree in single table using Fluent Nhibernate. Table must look like this: Model class: public class Category { public virtual int CategoryId { get; set; } public virtual string CategoryName { get; set; } public virtual…
user6408649
  • 1,227
  • 3
  • 16
  • 40
2
votes
0 answers

Fluent Nhibernate QueryOver take a long time for getting data from SQL Server

I created an Asp.Net MVC 5 web application using SQL Server 2014 and uses Fluent Nhibernate as ORM. I have a problem with execution of QueryOver queries. Execution of the query takes a very long time. I get generated SQL query from Nhibernate and…
vaqifrv
  • 754
  • 1
  • 6
  • 20
2
votes
4 answers

Best practice: should I use FK on DB using nHibernate/FluentNhibernate?

So far I always enforce my DB with FK relationship. Things changed yesterday while mapping some classes with FluentNhibernate. My mapping didn't work and I discovered that's the issue was because of the order FN create the query. Now a question…
Davide Vosti
  • 2,485
  • 2
  • 22
  • 31
2
votes
3 answers

Observable List Nhibernate

I'm attempting to have wpf databind to a collection of data models and, display them using datatemplates. Currently this is working perfectly when using an IList, however the databinding doesn't seem to pick up adds/removes on the IList. I'm…
2
votes
2 answers

NHibernate 3 GA LINQ with new Fluent NHbernate binaries boolean conversion issue

I have been using the NHibernate betas with Fluent NHibernate. Every thing has been fine until I moved to the GA release with all binaries coming from Fluent NHibernate http://fluentnhibernate.org/downloads The problem is the Oracle database has…
Paul Speranza
  • 2,302
  • 8
  • 26
  • 43
1 2 3
99
100