NHibernate Component Mapping VS IUserType -
hi know difference between 2 , why should use 1 on other , when?
your object model doesn't map 1 one database model , in cases richer. components way of enriching database model encapsulating functionality in object model. example lets have 2 tables, people
, companies
. both of these tables have fields required address
, database schema, whatever reason, doesn't have third table addresses
. in application might want model addresses separate entity though there no logical database table it. here use component allow project database fields address.
iusertype
way of mapping type column using custom serialization. example if map mongodb objectid
(which nothing more guid), write custom iusertype
mapping. other examples mapping bit mask array of rich user types or encoding/decoding encrypted field.
Comments
Post a Comment