nhibernate

nHibernate SchemaUpdate Failing

I'm trying to use the schema update feature in nHibernate against an Oracle 11g database and it's throwing the following exception: "More restrictions were provided than the requested schema ('Tables') supports." It appears to be an ado.net exception, but I can't find much information for it. Any insight towards this exception would be...

NHibernate proxyexception

Hi I am new NHibernate.I am writing the simple application that have cusstomer class contains id and name and using nhibernate i am storing the object to database. but i am getting the following The ProxyFactoryFactory was not configured. Initialize 'proxyfactory.factory_class' property of the session-factory configuration section with...

How to disable automatic loading in NHibernate?

This question might be a duplicate of this one: http://stackoverflow.com/questions/217761/nhibernate-disable-automatic-lazy-loading-of-child-records-for-one-to-many-rela I'd like to know if there is any way to tell nhibernate to do not load a child collections (best if it's with fluent Nhibernate) unless i do it manually with a query ...

What is NHibernate?

As a followup to my previous question. I am an ASP.NET Programmer, and am wondering how NHibernate would help me get my job done easier and more quickly than it would otherwise. Pretend I know nothing about NHibernate. What is it, and what can it do for me? ...

NHibernate Search without attributes

Is there any NHibernate Search library which doesn't require attributes on your entity properties? I'd like to keep my entities as clean POCOs, so perhaps there is a fluent interface? If not, perhaps I'll write one! Thanks ...

Exposing ID from 1:n relation / tree (NH)

I am trying to optimize a tree-structure for my category-model. The Category-model has a Parent-property and a Children-collection. The way i normally do this, is to load all categories (sounds bad, but max 100 nodes). The tree is then manually assembled, by indexing all categories by id, and then by looking up the parent by the catego...

[Active Record] How to get a list of objects with more then one initialized collection using Eager Loading and Detached Criteria?

I have a class with two many-to-many associations. After reading the AR docs I realised that I'm allowed to get only one collection at a time using eager loading. So how is it possible to get a list of objects with both initialized collections for each object using eager loading and DetachedCriteria? So far... DetachedCriteria dc = De...

Syntax to define a NHibernate Filter with Fluent Nhibernate?

It seems I can't find the correct syntax to define a nhibernate filter using fluent Nhibernate. I'm trying to follow this ayende's blogpost: http://ayende.com/Blog/archive/2006/12/26/LocalizingNHibernateContextualParameters.aspx I defined the formula on my property with .FormulaIs() method but can't find on google how to translate thi...

[NHibernate]How can I map multiple object types to one table?

My object model represents a podcast feed, with channel data and feed items (individual podcasts). This is structured as follows: PodcastFeed ChannelData // Property on PodcastFeed ITunesChannelData // Property on ChannelData FeedItems // Property on PodcastFeed; collection of PodcastFeedItems PodcastFeedItem ITune...

Nhibernate Tag Cloud

Hi, I'm trying to get a Tag Cloud architecture working in NHibernate. public class Tag : Entity { public virtual int Id { get; set; } public virtual string Text { get; set; } } This table will map to a few entities in my schema so I don't want to add a collection to the Tag class for each association. I do however want to qu...

Mapping files generation with nhibernate

i m new to nhibenate and i really find it painful to write the entire mapping files is there a tool or a vs addin that helps you do the mapping ? thx for your time :) ...

Return a List of typed object via CreateSQLQuery in NHibernate

Been trying to get the following query working for a few hours now and am running out of ideas. Can anyone spot where I'm going wrong. Any pointers much appreciated. CalEvents = (List<CalEvent>)session.CreateSQLQuery("SELECT * FROM dbo.tb_calendar_calEvents INNER JOIN dbo.tb_calEvents ON (dbo.tb_calendar_calEvents.calEventID = dbo.tb_ca...

NHibernate - Multiple one-to-many relations

I have very simple object structure for Person's and their marriage relations. I have exactly same structure in the db as well. public class Person { public virtual string Id { get; set; } public virtual ISet MarriageRelations { get; set; } } public class MarriageRelation { internal virtual int Id { get; set; } public vi...

NHibernate Traversal Question - Creating a Fluent Interface

I'm stumped with NHibernate and my Domain Model right now. I'm imagining a nice API in my head but I'm having a really hard time making it a reality. Here's an example of what I'm trying to accomplish: Trip trip = new Trip("Austria2009"); foreach(User user in trip.People.Crew.IsApproved()) { reponse.write(user.Firstname); } // Or ...

GenWise: Round trip code generation for nHibernate

I have been experimenting with GenWise and CodeSmith. I am looking for a tool that will: a) let me edit the data schema in SQL Server SSMS b) generate all the C# objects, xml etc from the database c) have lots of control over the genrated XML and C# d) do the "right thing" when generating code so that I can use the tool iteratively. ...

NHibernate Exception: No collection snapshot for orphan delete

Hello, I'm having an issue with NHibernate when I try to save an entity that has a collection of other entities. The example, Order and OrderLine. OrderLine is associated to Order with a Bag. Its cascade is set to Delete-Orphan and when I call SaveOrUpdate for an Order I call SaveOrUpdate for its OrderLines. The exception occurs in the...

nHibernate vulnerabilities

Hi guys, We have been using nhibernate for almost a year now. I wuld like to know that are there any vulnerabilities that could be injected(like SQL injection etc.) using web application. I just want to secure any nhibernate injection through web application if there are. ...

What would cause NHibernate to return an invalid identity selection when using JET?

Our application (sadly) uses an MDB back-end database (I.e. JET engine). One of the items being persisted to the database is an "event" object. The object is persisted to a table with an ID (EventLogID) that is an Autonumber field. The NHibernate mapping is as follows: <class name="EventLogEntry" table="tblEventLog" proxy="IEventLogEnt...

Spring.NET - Upgrade when Upgrading to NHibernate 2.0 from 1.1?

I want to upgrade to NHibernate 2.0 from NHibernate 1.1. Am I obliged to upgrade Spring.NET to v1.2 as well since we're using the NHibernate/Spring.NET integration module? We're currently publishing our releases under .NET Framework 3.0. ...

How to map auto property private set with NHibernate?

Suppose I have this class: public class GroceryListItem() { public GroceryList { get; private set; } public GroceryListItem(GroceryList groceryList) { GroceryList = groceryList; } } What is the NHibernate mapping file access strategy for this scenario? (i.e. <one-to-many name="GroceryList" column="XXX" access="?????" />) ...