NHibernate VS IUserType Component Mapping

Hi, I would like to know the difference between them and why should you use one over the other and when?

+5
source share
1 answer

Your object model does not necessarily map one to one with your database model and in most cases will be richer. Components are a way to enrich your database model by encapsulating functionality in your object model. For example, let's say you have two tables, peopleand companies. Both of these tables have the fields needed for address, but the database schema for some reason does not have a third table for addresses. In your application, you can model addresses as a separate object, although there is no logical database table for it. Here you should use a component that allows you to project database fields for an address.

IUserType - . , mongodb ObjectId ( ), IUserType . / .

+2

All Articles