nhibernate

How to map(NHibernate) a specified PostgreSql type ?

Hello guys... I have a PK (character (10)), that is mapped like that: The load works fine with npgsql 1.0, the sql generated with loadbyid is : SELECT city0_."IDCity" as IDMu1_92_0_ FROM "tblCity" city0_ WHERE city0_."IDCity"=E'BR420240' Using npgsql 2.0. the sql generated is : SELECT city0_."IDCity" as IDMu1_92_0_ FROM "tb...

NHibernate Aggregate Traversal (C#)

My application has a very simple model right now and I'm trying to find the best way to traverse through an aggregate. As you can see in my model diagram at the bottom, I have an account, a trip and a list of people attending a trip. I would like to be able to view all of the trips an account is apart of and I have come up with something...

How to delete a child of multiple parents in Nhibernate?

I have 3 tables: Media Selectionlist and then an intermediate table for saving media that are in a certain selectionlist called selectionlist_mediamembers. I have mapped them as following: Media.xml <bag name="SelectionlistMediamembers" lazy="true" cascade="all-delete-orphan" inverse="true" where="deleted = 0" > <key column="m...

NHibernate in disconnected scenarios

What are your experiences with the latest version of NHibernate (2.0.1 GA) regarding disconnected scenarios? A disconnected scenario is where I fetch some object graph from NHibernate, disconnect from the session (and database connection), do some changes in the object graph (deleting in collections, adding entities, updating entities) ...

with nHibernate, what happends when you want to return an object that doesn't map to a table/entity?

With nHibernate, what happends when you want to return an object that doesn't map to a table/entity? ...

NHibernate find

I have a 'Customer' table with 'FirstName' and 'LastName' columns. I have to execute a search on the 'Customer' table after 'FirstName', 'LastName' and 'FirstName + LastName' depending on a TextBox text. What's the besty way/query to implement this using NHibernate or SQL query? ...

How to set a configuration property when using fluent nhibernate?

In particular, I'd like to set current_session_context_class. I know how to do it in hibernate.cfg.xml, but is it possible at all with pure fluent configuration? ...

WebDev Issue when works with Nhibernate

Dear All, I have a Nhibernate Class Library, And Web App references it, I get data form Product table, It's fine, but when i refresh it, I occur this issue. Please see image below: http://vi-vn.com/pubs/images/NhibernateWeb.jpg Thanks, NeonQuach ...

ASP.Net MVC & NHibernate Burrow & Fluent NHibernate

Hi all I am getting the following runtime error in my ASP.Net MVC application: NHibernate.MappingException: No persister for: MyProject.Model.MyDomainObject I am referencing the burrow and fluent binaries in my application and am reconfiguring burrow in Global.asax on Application_Start as follows: var bf = new BurrowFramework(); IFr...

NHibernate: No persister for NHibernate.Criterion.SqlFunctionProjection

Hi I am using NHibernate version 2.0.0.4000. In one of my queries I wanted to make use of the sql function dateadd to add a number of days. This wasn't registered so I created my own dialect and registered the function as follows: RegisterFunction("adddays", new SQLFunctionTemplate(NHibernateUtil.DateTime, "dateadd(dd, ?1, ?...

Fluent NHibernate Map Address Type

Hi, I have a Customer table and an AddressTable. My table looks like this : Table Customer { ID, Name } Table Address { ID, CustomerID, AddressType, Address } (AddressType is 1 for HomeAddress and 2 for WorkAddress) In my Customer class I have 2 properties for Address type class Customer { Address HomeAdress; Address WorkAddress;...

Error using NHibernate

Considering this example as a base example. I created the application but when I execute this application getting the following error. The ProxyFactoryFactory was not configured. Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with one of the available NHibernate.ByteCode providers. Ex...

(Fluent) NHibernate dictionary mapping with class Key

Domain: class Category string Name class Product IDictionary<string, Product> Parents Tables: Categories (ID, Name) Products (ID) ProductParents (ID, ParentID, ChildID, CategoryID) The questions: I need to get list of parent products. Is it possible to map parent products to dictionary so that I can do: produ...

Fluent NHibernate mapping

Hi I've got 2 entities and splitter table for many-to-many relationship: CREATE TABLE T_CUSTOMER ( CUSTOMER_ID NUMBER NOT NULL ) CREATE TABLE T_CC ( CC_ID NUMBER NOT NULL ) CREATE TABLE T_CUSTOMER_CC_SPLITTER ( CCCU_CUSTOMER_ID NUMBER NOT NULL, CCCU_CC_ID NUMBER NOT NULL, STATUS NUMBER NOT NULL ) I'...

Comparing the schema of two databases for integration testing.

We use NHibernate generated schema to run unit tests against a database (integration tests I guess they are). I wondered if it was feasible to compare the generated schema against our development database. This would tell us when we had misspelt column names in our mappings or other issues like that. It would also go a long way toward ke...

How to see the the HBM from mappings was built in runtime?

I have a predefined Configuration instance where I'm fetching ClassMappings and adding some extra properties depends on MappedClass nature. And I have a problem with a propery maps wrong. Is there any way to build the HBM presentation from the presented configuraion to be able to see the errors by eyes? ...

How much logic should i put my repository methods when using repository pattern?

Hi, i'm struggling a bit with repositories. I'm using C# and NHibernate. The question i have is : how much should my repository do before it calls a save or a get? For example i have a user class which is an aggregate root. I want to call a method called "register" which will add the user and set some default values based on business ...

NHiberate mapping question

I have 2 entities- Classroom and Section, that I need help with NHibernate mapping. A Classroom has a collection of Sections. And the Section has a reference back to its owner Classroom. On the code side: public class Classroom { public int Id { get; set; } public ISet<Section> Sections { get; set; } } public class ...

NHibernate on Azure?

Has anyone tried NHibernate on Azure? Is there conflicts with the medium trust or SQL integration? Thanks, Chance ...

The ProxyFactoryFactory was not configured

Considering this example as a base example. I created the application but when I execute this application getting the following error. The ProxyFactoryFactory was not configured.Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with one of the available NHibernate.ByteCode providers. Example: ...