nhibernate

Are there any starter kits that uses all of : ASP.Net MVC 1.0 with Nhibernate. Sparkview, Jquery, Jquery UI?

I am looking for a starter kit that already is set up with the following? ASP.NET MVC 1.0 Jquery/Jquery UI/JqGrid/ Sparkview engine NHibernate Code quality is important as well. Thanks in advance. ...

NHibernate QueryException: Type mismatch, expected type == actual type

We have this really weird problem in a Web Application when using ActiveRecord 2.0 with NHibernate 2.1.0 (have also tried 2.1.2). I'm sorry if this description is a little vague, but we are having problems understanding exactly what is going on. We are working on a large enterprise application, where we are trying to isolate the problem ...

Fluent Nhibernate How to specify Id() in SubclassMap

Hello, I'm in the process of adapting Fluent NHibernate to our existing legacy app and am trying to determine how to use ClassMap and SubclassMap for the entity hierarchy shown. // BaseObject contains database columns common to every table public class BaseObject { // does NOT contain database id column public string CommonDbCol...

NHibernate createQuery with colons from method cal

I get a Antlr.Runtime.NoViableAltException thrown when trying to run the following query in NHibernate. IQuery query = session.CreateQuery("from <table> where 1 in (select <column>.STIntersects(geography::STGeomFromText('POINT(:longitude :latitude)', 4326)))"); I'm setting longitude and latitude in setQuery. my assumption is the :: i...

How to get stores with more than 2 products which price is greater than 2.0$ ?

Each Store has many Products. Store --> (N) Products How to create an NHibernate criteria to get stores with more than 2 products which price is greater than 2.0$ ? I know how to get Stores based on a criteria on Products and I also know how to get the count of Products which Price is greater than 2, but I can't find a way to put ...

Why even the simplest NHibernate Example criteria isn't working?

I want to do the simplest job: Getting products which name is "Potatoes". // solution 1 - Using Expression.Eq return session.CreateCriteria<Product>().Add(Expression.Eq("Name", "Potatoes")).List<Product>(); // solution 2 - Using Example Product exampleProduct = new Product(); exampleProduct.Name = "Potatoes"; return session.Cre...

NHibernate number format problem - where do I set the culture?!

LATER EDIT : It was me :( It was a non-nullable column left unfilled. Sorry to everyone I confused.. I am having issues with an INSERT statement generated by NHibernate because it formats the decimal numbers using the regional settings. The generated statement goes something like : exec sp_executesql N'INSERT INTO [TableName] ( Co...

Is NHibernate SchemaUpdate safe in production code?

For simplicity's sake. I'm using Fluent NHibernate's Automapping combined with NHibernate's SchemaUpdate during runtime. On each run Automapper creates mappings for all entity classes and SchemaUpdate applies the schema to the existing database. I was pleasantly surprised that it works correctly against an empty database as well. It's wo...

nhibernate should i flush session explicitly after "SaveOrUpdate"?

I have written an integrationtest that fails: [Test] public void Find_WorkItemWithMatchingDescriptionExistsInRepository_ReturnsWorkItem() { // arrange WorkItemRepository repository = new WorkItemRepository(IsolatingFactory); const string Description = "A"; WorkItem itemWithMatchingDescription...

Fluent NHibernate mapping a reference to a column that is not the ID column.

I am using Fluent Nhibernate 1.0 with Sharp Architecture 1.0 Currently I am trying to map a reference to a ZipCode class. The current class I am mapping has a ZipCode column, but the zipcode class is much more extensive than what is needed for a basic zipcode, hence the reasoning behind this. (Basically Zipcode class contains lat. and...

Nhibernate, error performing isolated work

First question here I have a parent object with child object I'm using hilo generator and spring transaction manager the save operation give the error in the title. ...

.Net class with NHibernate and XmlSerializer

Have a .net class that I want to persist/retrieve to/from Oracle 11g database using NHibernate. Contains an array of objects that NHibernate insists must be the interface type IDictionary, ISet, or IList. I also need to serialize the class to XML using XmlSerializer, however, XmlSerializer cannot serialize members of type IList (for exa...

Latest Binary builds of FLuentNhibernate + Nhibernate + Linq for NHibernate

do people build there own versions of all this? or is there a place to get all this prebuilt? I got the latest FluentNhibernate which has NHibernate but no Linq.... but I don't really want to setup a ruby rake build system etc etc unless I really really have to! Prefer to just get all the binaries I need. ...

How do I group expressions in NHibernate?

How can I group sets of expressions in NHibernate? For example, I want to filter my query like so: (ShowOnDate IS NULL OR ShowOnDate <= GETDATE()) AND (ExpirationDate IS NULL OR ExpirationDate >= GETDATE()) I can add the 4 criterions separately, but I can't figure out how to emulate the paranthesis grouping. Thanks! EDITED to show ...

Custom entity creation (construction) in NHibernate

I have Order class and SubOrder: Order descendant. Now, Order has .Item and SubOrder (obviously) has it, too, but SubOrder needs SubItem to be there. Which is easy when created: Item = new SubItem((ISomeInterface)this); but how do I tell NHibernate to create SubItem instead of Item when it loads SubOrder from database (Session.Get<Sub...

'The SELECT permission was denied on the object ' when working with views on separate schema

Note: This is a community wiki entry and is mainly to document a problem together with its solution. I was hardly able to find information on the net to solve this. Hope it helps someone! I have a SQL-Server 2005 DB with the data tables being on the dbo schema. For a new component on the project, I created a new data access layer (us...

SOLID SRP and FluentNhibernate entities

this class is from http://wiki.fluentnhibernate.org/Getting_started it has some logic in it and I think this violates the Single Responsibility Principle, how do you think, how would you resolve this ? Another thing that bothers me is why in nhibernate always it is being used IList and not IEnumerable which has less functionality ? pub...

How can I pass teo expressions for a same column in an hibernate

I want to query a column with two enumerations values. If enum==a or enum==b matches for that column in databse then return me. Does anybody know to do this? I cna make for one enum, but how to add another enum into this. System.Collections.ArrayList list = (System.Collections.ArrayList)_mapper.Run(delegate(ISession session, object[] a...

ASP.NET MVC application when deployed to IIS 7 in integrated mode using NHibernate data will not load

We have built an ASP.NET MVC application which utilizes NHibernate, the MVCContrib version of StructureMap, and an onion architecture as outlined by Jeffery Palermo in ASP.NET MVC in Action. This application works well when running locally from Visual Studio 2008. The Index action on our Home controller loads a view which immediately pu...

Eager load while using Linq in NHibernate 3

I need help with eager loading in with Linq in NHibernate 3 trunk version. I have a many-to-many relationship like this: public class Post { public int Id {get;set;} public IList<Tag> Tags { get;set;} . . . } Now I have the following mapping in Fluent NHibernate public class PostMap:ClassMap<Post> { public ...