fluent

Fluent Nhiberhate And Missing Milliseconds

I am using Fluent Nhibernate and Nhibernate for my current project. I need to record the time to the millisecond. I have this for my mapping Map(x => x.SystemDateTime) .CustomType("Timestamp") .Not.Nullable(); I genertaed the hbm.xml files and the line is the following: <property name="SystemDate...

Fluent NHibernate fetching view without unique identifier

I'm trying to map a view without an identifier, but nhibernate still generates a sql with the id column (giving me a sql error, since the ID column does not exists in the db). Maybe I'm misunderstanding the Id() constructor? constructor comments: Create an Id that doesn't have a corresponding property in the domain object, or a column ...

Fluent Nhibernate external configuration

Hi! All examples of fluent nhibernate make such(or similar) call: c.AddMappingsFromAssembly(typeof(Product).Assembly); I don't want tu use "typeof(Product).Assembly" as i don't want to have reference to my domain project here ("Procuct" class). In ordinary NHibernate I would just create hbm.xml files and make following entry in web.co...

How to debug Fluent nHibernate

Hi, I'm having some trouble with Fluent nHibernate. I added a column to a table and I thought I'd correctly changed the mappings and the connected data objects to correctly reflect this. However when I tried to run my application again I kept getting this error: System.Data.SqlClient.SqlException: Invalid column name 'Workflow_id'. I...

Anyone know of any decent resources on Stored Procedures for Fluent Nhibernate 1.1

A recent release of Fluent Nhibernate (1.1) now supports stored procedures. I was wondering if anyone out there has found any good blog articles on how to do this! I am not asking about using classic hbm mappings instead which these questions previously asked: http://stackoverflow.com/questions/296732/does-fluent-nhibernate-support-map...

Fluent mapping help

Hi, This is probably a very simple question but I'm new to nHibernate and I'm having trouble working this out. I have a Page object, which can have many Region objects. I also have a Workflow object. Page and Region objects both have a relationship to Workflow and it's this double association that I'm having trouble with. The PageMap...

Fluent nHibernate saving null id - leaves orphans

Hi, I'm witnessing some strange behaviour from Fluent nHibernate. I have two objects involved in this problem: a "Page" object and a "Metadata" object. A Page can have multiple Metadata objects attached, and the mapping is done thus: 'in PageMap HasMany(Function(x) x.MetaData).Cascade.All() 'in MetaDataMap References(Function(x) x.Page...

Is it possible to set ExecuteUpdate to respect session filters?

The query below makes use of ExecuteUpdate. I want said method to respect session filters. Is this possible? //This line seems to make no effect. _session.EnableFilter(FilterName).SetParameter(FilterParam, Value); _session.CreateQuery(String.Format("DELETE FROM {0} WHERE Id IN (:idList)", object.Name)) .SetPar...

Fluent NHibernate: testing collection mapping with CheckList

Hello guys. I've used Fluent NH in some projects but I'm having some problems with using the PersistenceSpecification class for testing a collection mapping. Here's the code for my classes (I'm just putting here the collection definition): public class Ocorrencia : EntityWithAction, IHasAssignedId<Int32> { private IList<Interve...

asp.net mvc nhibernate unit testing

Hello there How can I write a unit test for CRUD using in memory database with fluent nhibernate ...

Fluent Nhibernate System.ApplicationException : For property 'Id' expected '1' of type 'System.Int32' but got '2' of type 'System.Int32'

Hi I am writing unit tests for fluent Nhibernate, when I run the test in isloation it passes, but when I run multiple tests. or run the test more than once it starts failing with the message below System.ApplicationException : For property 'Id' expected '1' of type 'System.Int32' but got '2' of type 'System.Int32' [TextFixture] public ...

Sharp Architecture and Fluent NHibernate 1.1

Hi All: I am new to this group so apologies if this has already been answered (I have had a good look). I am having a look at sharp architecture for a project I'm soon to start out on. I am experimenting with the Northwind sample, and wanted to test a self referential relationship, but discovered Fluent NHibernate 1.1 was needed (see h...

Fluent configuration problem

I'm trying to get fluent configuration working without success. I get the following error: Activation error occured while trying to get instance of type LogWriter, key "" when I try to access the logwriter: Dim logwriter As LogWriter = EnterpriseLibraryContainer.Current.GetInstance(Of LogWriter)() Configuration: Dim formatBuild...

nHibernate object mappings create key violations

Hi, Got a bit of an odd situation which I'm trying to map in Fluent nHibernate and failing. I have an Asset object which contains both an Image object and a File object. The Id of Image and File is identical, and the Image object contains a File object. This situation arises because an Image is always also a File (which is why the Id's ...

Fluent Validation and libraries

Hello, While looking for something totally different the other day, I have stumbled upon two libraries for doing Fluent Validation in .NET. The concept seems interesting since so far I am doing my validations using the usual conditional and branching statements (if, else, case, etc). In particularly, it makes relatively easy to chain s...

Using custom C# attributes to select Fluent conventions

Suppose you have sets of Fluent conventions that apply to specific groups of mappings, but not to all of them. My thought here was, I'll create custom C# attributes that I can apply to the Fluent *Map classes - and write conventions that determine acceptance by inspecting the *Map class to see if the custom attribute was applied. That ...

How to change the Fluent Ribbon UI backstage color

How do I change the color of the Fluent Ribbon UI backstage menu which is – by default – blue? ...

Fluent NHibernate 1.1 with Microsoft Access 2007 Database

Is it possible to use Fluent 1.1 with Access? I found this site here that shows how to create a configuration file that can be passed into Fluently.Configure(config). The issue with this is that you need to use NHibernate 1.2.1 which Fluent gets upset with because it has a reference to version 2.1.2.4000. Here is the error: Error 1...

Using NHibernate to Index Large Amounts of Data in Lucene.Net

We are using Nhibernate as our data access layer. We have a table of 1.7 million records which we need to index one by one through Lucene for our search. As we run the console app we wrote to build our index, it starts off fast, but as it goes through the items, it progressively gets slower and slower. Our First iteration was to just ...

Fluent nHibernate using AsList() returns null objects depending on the SortOrder

In a project I am working on, we are using tabs. These tabs have content. Multiple content objects can be on a tab. So we could have a 'car' tab, and that car tab may display a sedan content object, a suv content object and a truck content object. The user could also specify that it contains more or less of these objects and order them h...