c# - Mapping an Array using Fluent N Hibernate -
i not sure if fluent n hibernate can or not, cannot figure out how.
i have table - cases , properties
ownerid, brokerid, shipperid
i want map property:
int[] orgswithaccess
is possible?
this way when checking if org has access case, can check property orgswithaccess rather ownerid == myorg.id or brokerid == myorg.id etc.
if understand question correctly, wouldn't recommend trying map in way have asked.
cases
table looks form of junction table between other tables. i'll assume these other tables each contain data represented entities in application, , there 3 tables, owner
, broker
, shipper
.
orgswithaccess
should mapped using references entities has in application i.e. assume class looks like
public class orgswithaccess { public virtual owner { get; set; } public virtual broker { get; set; } public virtual shipper { get; set; } }
then mapping like
public class orgswithaccessmap : classmap<orgswithaccess> { public orgswithaccessmap() { references(x => x.owner); references(x => x.broker); references(x => x.shipper); } }
then when querying, @ properties on orgswithaccess
session.queryover<orgswithaccess>().where(x => x.owner.id == id);
Comments
Post a Comment