For the Placement object, we have two columns with a zero value: CollectionTypeand AccommodationUnitType.
However, in the data, I noticed that they were set to zero and not to zero, as a result of which NHibernate tried to find the object with identifier 0. It was a lot of extra unnecessary DB calls, so I updated the corresponding data to NULL in the database, and suddenly I get a big fat error:
"Invalid index 24 for this SqlParameterCollection with Count = 24"
Here is an override of the mapping I'm using:
public void Override(AutoMapping<Core.Entities.Itinerary.Accommodation.Accommodation> mapping)
{
...
mapping.References(x => x.CollectionType).Nullable();
mapping.References(x => x.AccommodationUnitType).Nullable();
Cache.Is(c => c.ReadWrite());
}
There are many answers on Google that seem to have nothing to do with my problem.
Any ideas?
Edit
, :
public virtual AccommodationUnitType AccommodationUnitType { get; set; }
public virtual AccommodationCollectionType CollectionType { get; set; }