orm - Supply default default value in NHibernate mapping for unused columns -


my domain object doesn't use 2 non-nullable columns table in database. both of columns guids. there way can supply default value these columns in mapping file i'm able save domain object database?

you have few options:

  • provide own <sql-insert> in hbm.xml file. unfortunately forces take control of insert logic.
  • map columns private fields within object aren't exposed , set guids when create new instance. nhibernate can save these fields when inserting. can mark mappings update="false" they're ever inserted.
  • add default values columns in database schema.

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -