nhibernate

NHibernate Oracle stored procedure problem

------Using VS2008, ASP.Net with C#, Oracle, NHibernate---- I have tested my stored procedure. It's working but not with NHibernate. Here are the codes: Procedure : create or replace procedure ThanaDelete (id number) as begin delete from thana_tbl where thana_code = id; end Mapping File: <?xml version="1.0" encoding="utf-8" ?> <hib...

eager fetching produces 2 queries

Hello I was experimenting with NHibernate tonight and i got little confused with Eager fetching. I created 6 tables with 1-many relation ships and I am trying to eager fetch them in 1 database query. In my example I have Products that consists of Parts that consists of Materials that consists of Materials that consists of Materials that ...

Eager loading a tree in NHibernate

I have a problem trying to load a tree, this is my case, I have an entity associated with itself (Hierarchic) with n levels; the question is, Can I load eagerly the entire tree using ICriteria or HQL? Thanks in advance for any help. Ariel ...

NHibernate and SQLite exception

When i try to deploy mapped table into database with GenerateSchema..i get the exception: NHibernate.HibernateException: Could not create the driver from NHibernate.Driver.SQLiteDriver. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> NHibernate.HibernateException: The I...

NHibernate: how do I Merge class without identifier property?

The Merge seem not to have an overload for providing an id, and while SaveOrUpdateCopy does, it still crashes with The class has no identifier property. I am ok with loading the entity first, but is it possible to merge to a given entity with NH? Copying all fields by hand seems unnecessary given that there is already merge functionalit...

Fluent Nhibernate Conventions

I'm trying to adapt these conventions for my project. Not-Null as the default Varchar instead of nvarchar I attempted the first one using the following code. However, it didn't work. public void Accept(IAcceptanceCriteria<FluentNHibernate.Conventions.Inspections.IPropertyInspector> criteria) { criteria.Expect(c => c....

Get Score with NHibernate.Search

I'm currently trying to use NHibernate.Search, but i need to get score for each results returned by the query. Anyone know something about how to do that ? Thanks. ...

NHibernate Batch Size across entire app - any problems?

If I configure NHibernate with a batch size of say 20, am I likely to run into problems in regular, non-batch-update related scenarios? The majority of updates/inserts performed by my application are once-offs. But in certain cases I am doing large scale updates/inserts which would benefit from batching. Should I use a different session...

Using NHibernate in Asp.Net MVC

HI All, What are the steps to use NHibernate from the model component of MVC? ...

NHibernate - composite-id - 3

I have a class in Nhibernate hbm file and for this I'm using a composite id field, in the following way : <composite-id> <key-many-to-one name="DContent" class="Business.Entities.DContent, Business" column="DId" /> <key-many-to-one name="Structure" class="Business.Entities.Structure, Business" column="RId"/> <key-property...

NHibernate latency is very high

I am using NHibernate for ORM and have consolidated the loading of lots of entities into one big query. I am actually loading a word dictionary, around 500K entries, and each word relates to others. Running the loading process in the background could be very tricky in our application, as we would have to manually load an entry that has ...

NHibernate TDD with oracle in ASP.Net

Hi, I am working on NHibernate with oracle in ASP.Net. Now i am trying TDD(Test Driven Development). Can you tell me the best way to develop the TDD for NHibernate with oracle? I am using MbUnit with microdesk but it is not better approach for oracle but SQL server. Please give suggestions... ...

NHibernate Concurrency Issue

Over the weekend I realized that an application I'm working on which uses NHibernate as an ORM to a sqlite database has a concurrency issue. I'm essentially looping through a collection in javascript and executing the following: var item = new Item(); item.id = 1; item.name = 2; $.post("Item/Save", $.toJSON(item), function(data, testSt...

Auto generation of ID

I need to generate an id with the following features: Id must be unique Id consist of two parts 'type' and 'auto incremented' number 'type' is integer and value can be 1, 2 or 3 'auto incremented' number starts with 10001 and incremented each time id is generated. type is selected from a web form and auto incremented number is from t...

Using CreateCriteria within PreInsert/PreUpdate Event Listener

Hello all, I want to have a centralize place to check for inserts or updates to an object, and for certain scenarios, I want to update it's parent based on the information from the child. I have the following code in my event listener: public bool OnPreInsert(PreInsertEvent @event) { UpdateCalcs(@event.Entity); ret...

NHibernate: Pre Insert Event for Composite Element

Is there an NHibernate event that fires before a composite element is inserted? ...

Nhibernate: Retrieving column names from CreateSqlQuery

When using CreateSqlQuery, is it possible to retrieve an ordered list of the returned column names? Using .List only returns a list of the object values, not the column aliases. ...

nhibernate flush by entity basis

hi, im using nhibernate 2.1.2 and i know that call session.flush will execute the SQL against database for all the entity changes, can nhibernate allow to flush per entity basis?? for instance, i have make changes to entity1 and entity2, but i only want to flush entity1 first then later entity2. it's anyway nhibernate allow to do so?? ...

nHibernate batch insert doesn't work with associations?

I'm trying to find more information about how nHibernate decides how to batch multiple inserts together. Apparently it just works if you have a simple list of objects of the same type, with no children objects. In my application, I have a one-to-many relation between three tables A, B, and C: A has many B, B has many C. I'm using a nati...

Are Nhibernate Helper Kits available for VS2008?

Can anyone help me out by providing some information on Nhibernate Helper Kits for VS2008 and which all are open source and which all are not. Can also anyone share some links that give information on using NHibernate with ASP.NET MVC ...