2010-03-02 17:56:21 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.Serialization;
|
2011-02-18 16:54:48 +00:00
|
|
|
|
using Tanshu.Accounts.Contracts;
|
2014-10-12 09:41:45 +00:00
|
|
|
|
using NHibernate.Mapping.ByCode.Conformist;
|
|
|
|
|
using NHibernate.Mapping.ByCode;
|
|
|
|
|
using System.Collections.Generic;
|
2010-03-02 17:56:21 +00:00
|
|
|
|
|
2011-01-30 07:14:05 +00:00
|
|
|
|
namespace Tanshu.Accounts.Entities
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public class Waiter
|
2010-03-02 17:56:21 +00:00
|
|
|
|
{
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public virtual Guid WaiterID { get; set; }
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public virtual string Name { get; set; }
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public virtual IList<Voucher> Vouchers { get; set; }
|
|
|
|
|
}
|
|
|
|
|
public class WaiterMap : ClassMapping<Waiter>
|
|
|
|
|
{
|
|
|
|
|
public WaiterMap()
|
|
|
|
|
{
|
|
|
|
|
Table("Waiters");
|
|
|
|
|
Schema("dbo");
|
|
|
|
|
Lazy(true);
|
|
|
|
|
Id(x => x.WaiterID, map => map.Generator(Generators.GuidComb));
|
|
|
|
|
Property(x => x.Name, map => { map.NotNullable(true); map.Unique(true); });
|
|
|
|
|
Bag(x => x.Vouchers, colmap => { colmap.Key(x => x.Column("WaiterID")); colmap.Inverse(true); }, map => { map.OneToMany(); });
|
|
|
|
|
}
|
2010-03-02 17:56:21 +00:00
|
|
|
|
}
|
|
|
|
|
}
|