why does hibernate not force you to mark fields as virtual, but nhibernate does?
why does hibernate not force you to mark fields as virtual, but nhibernate does? Is this a result of the differences between the VM and CLR? ...
why does hibernate not force you to mark fields as virtual, but nhibernate does? Is this a result of the differences between the VM and CLR? ...
I have a property on my domain object which is exposed as this: public virtual IEnumerable<WorkPost> WorkPosts { get { return sheetPosts; } private set { Guard.AssertAssignableFrom(value, typeof (IList<WorkPost>)); sheetPosts = value as IList<WorkPost>; } } The intern...
I am migrating a project from NHibernate 1.2 to Nhibernate 2.1, and I have run into an odd error. NHibernate is loading duplicate copies of child entities into collection properties. Has anyone else run into this problem, and can you suggest a fix? Thanks for your help. Here are the problem details: My project is a simple Project Manage...
All of my NH entities derive from a type called BusinessEntity, it has the most basic values ID, Created, CreatedBy, Updated, UpdatedBy. CreatedBy / UpdatedBy takes a User I have a IPreUpdateEventListener and IPreInsertEventListener that fire to get the current DateTime for the audit values. Also in here I have my logic to get the curr...
I have been struggling with this NHibernate issue for hours. I extensively researched on the web as well as the NHibernate documentation, and I can make no sense of this issue. I'm relatively new to NHibernate, and love it. In that case, though, it's driving me mad. I'm writing a small "Poll" module for a website. I have several classes...
Ok, i have two entities named WorkPostSheet and WorkPost where the WorkPostSheet contains a collection of WorkPost-items: public class WorkPostSheet { ... public virtual IEnumerable<WorkPost> WorkPosts { get; private set; } } In my integration test, i notice that nhibernate creates an update statement ...
I'm trying to utilise FluentNHibernate with Automapping but am receiving the following error No persister for: nHibernateSpike.Entities.Route NHibernate.MappingException: No persister for: nHibernateSpike.Entities.Route Here's the relevant stuff; var model = AutoMap.AssemblyOf<Route>(). Where(t => t.Namespac...
Hi, I'm wondering if it is possible to do direct SQL updates of my own in the same transaction as NHibernate is using to update my persistent objects? ...
I am (hopefully) just about to start on my first NHibernate project and have come across a stumbling block. Would appreciate any advice. I am working on a project where my new code will run side-by-side with legacy code and I cannot change the data model at all. I have come across a situation where one of the main tables has no primary ...
Hi guys, I have this WPF application using NHibernate and lazy data loading. I also use Microsoft Sync framework to sync data to and from a central database server. So what happens is that when I modify data on the central database server and sync it with the WPF client app, I can't get the latest data to be displayed to the UI since NHi...
I define my data model using Fluent nHibernate POCO classes + mappings. I'm also using nHiberate schema to create database schema. All is working fine but there is one unpleasent fact. When I use many-to-one reference referece is named by something similair to GUID instead of any descriptive name. Here's a piece of SQL: alter table [Odb...
I'm using NHibernate + Fluent to handle the database in my application. So far I've been using a SessionSource to create my ISession objects. I'm a bit confused now about what comes from NHibernate or Fluent, and what I really should use for creating my sessions. ISession comes from NHibernate, and the SessionSource from Fluent. I crea...
Hello Nhibernate users, professionals, gurus and developers are expected. Please help !!! I want to realise a n:m relation between two classes. A student attends in more courses and a course consists of more students as members. I do a bidirectional association many-to-many with bag to get the both lists from each site. The two Studen...
I am about to start a project using NHibernate and Script# NHibernate required that all properties be virtual, so I have my entity like this: public partial class User { public virtual string Username { get; set; } public virtual string PasswordHash { get; set; } public virtual DateTime DateRegistered { get; set; } } But...
Whilst playing around with an nhibernate mapping, I noticed that a property setter I had was being overloaded (or ignored). This is expected default behaviour with an nhibernate mapping. So I changed it to use the field.camelCase - so NHibernate would set the private field of the entity class and not the propety getter/setter so I could...
I've been at this for days. I have configure my web/app config to use the second level cache with a Memcached server and the provider from NHContrib. I don't get any exceptions yet in testing I see that it does not use the cache for my queries that I have set cacheable = true. If I switch the provider to the NHibernate.Cache.HashtableCac...
Hello I am using NHibernate for a project, and I am absolutely beginner. I am fetching some objects from a table and showing it to a form, where they can be edited. If an user inserts a new object into the table from some other window, I want to show this newly inserted object into the edit window. My application uses tabbed window inte...
Is it possible to map a collection in Hibernate the same way that "HasMany :through" associations work in Ruby on Rails? ...
I have a Custom EventListener hooked into listen for SaveOrUpdates and now whenever I call Session.SaveOrUpdate on my object it inserts when it should update. Here is my Event Listener: public class CustomSaveEventListener : DefaultSaveEventListener { protected override object PerformSaveOrUpdate(SaveOrUpdateEvent @event) { ...
I have a class of type MetadataRecord: public class MetadataRecord { public virtual long? IntegerObject { get; set; } public virtual string ClassName { get; set; } public virtual DateTime? DateObject { get; set; } public virtual double? DecimalObject { get; set; } public virtual long MetadataId { get; set; } publ...