c# - Define generator for composite-id property in NHibernate -
i've defined composite-id nhibernate database model. seems work, cannot set generator 1 key-property.
is possible define generator key-propery in composite-id?
c# nhibernate model
public const string str_id = "id"; public const string str_shardkey = "shardkey"; [compositeid(-4)] [keyproperty(-3, name = str_id, column = str_id)] [keyproperty(-2, name = str_shardkey , column = str_shardkey )] [generator(-1, class = "guid.comb")] public virtual guid? id { get; set; } [column(name = str_shardkey )] public virtual int shardkey{ get; set; } xml mapping
<composite-id> <key-property name="id" column="id" /> <key-property name="shardkey" column="shardkey" /> </composite-id> shouldn't there generator tag <generator class="guid.comb" /> somewhere?
Comments
Post a Comment