Hi, I'm trying to restore the collection of the building domain.
Private long _id; Private string _building name; Private IELIT & Lt; Basic ARM & gt; _rooms;
I am using this mapping for NHibernate and rooms
& Lt; One-to-many classes = "cell" /> & Lt; / Bag & gt;
And I'm calling DB this way;
Buildings = (list & lt; building & gt;) session. Creterettia (typef (building)). Order (.order.Asc ("buildingName")) from the list & lt; Building & gt; ();
The problem is that I do not want to do an ILID collection, but I should have a list of it, Hi, NHibernate requires that I use an interface for archiving, How to do it I am new to the net and I am thinking that NHibernate can go beyond falling. I should be typed as a list of collections so that I can go ahead and appreciate any help very much.
Not that how NHibernate works You can not tell that your domain model objects are concrete What types are you can only tell what the base type and interface are. So it chooses how to efficiently implement the domain type. For example, NHibernate IList & lt; T & gt; Uses its internal implementation of
which knows how to load lazy.
In addition, NHibernate uses its internal implementation of the building
from its domain model. It is not necessary that the case is that all the buildings
objects You will use with NHibernate, their solid type will be in the form of Building
. It is only the fact that they are building
s, whether building
is a concrete type of your object, or whether it is the base type of the concrete type of your object.
But it's doing the right thing , because you're using respect instead of concrete type of interface and base type. NHibernate helps you to use all the correct methods of programming.
Now, you'll see the list & lt; Building & gt;
Why are required per? IList & lt; Building & gt;
Why will not it be enough?
Comments
Post a Comment