2011-08-23 07:10:05 +00:00
|
|
|
|
using System;
|
|
|
|
|
using Tanshu.Accounts.Entities.Auth;
|
2014-10-12 09:41:45 +00:00
|
|
|
|
using NHibernate.Mapping.ByCode.Conformist;
|
|
|
|
|
using NHibernate.Mapping.ByCode;
|
2011-08-23 07:10:05 +00:00
|
|
|
|
|
|
|
|
|
namespace Tanshu.Accounts.Entities
|
|
|
|
|
{
|
|
|
|
|
public class Reprint
|
|
|
|
|
{
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public virtual Guid ReprintID { get; set; }
|
2011-08-23 07:10:05 +00:00
|
|
|
|
public virtual User User { get; set; }
|
2014-11-06 10:39:11 +00:00
|
|
|
|
protected DateTime _date;
|
|
|
|
|
public virtual DateTime Date { get { return _date; } }
|
2011-08-23 07:10:05 +00:00
|
|
|
|
public virtual Voucher Voucher { get; set; }
|
|
|
|
|
}
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public class ReprintMap : ClassMapping<Reprint>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public ReprintMap()
|
|
|
|
|
{
|
|
|
|
|
Table("Reprints");
|
|
|
|
|
Schema("dbo");
|
|
|
|
|
Lazy(true);
|
2014-11-02 08:03:31 +00:00
|
|
|
|
SqlInsert(@"exec ReprintInsert ?,?,?");
|
2014-10-12 09:41:45 +00:00
|
|
|
|
Id(x => x.ReprintID, map => map.Generator(Generators.GuidComb));
|
2014-11-02 08:03:31 +00:00
|
|
|
|
Property(x => x.Date, map =>
|
|
|
|
|
{
|
|
|
|
|
map.NotNullable(true);
|
|
|
|
|
map.Generated(PropertyGeneration.Insert);
|
2014-11-06 10:39:11 +00:00
|
|
|
|
map.Access(Accessor.NoSetter);
|
2014-11-02 08:03:31 +00:00
|
|
|
|
});
|
2014-10-12 09:41:45 +00:00
|
|
|
|
ManyToOne(x => x.User, map =>
|
|
|
|
|
{
|
|
|
|
|
map.Column("UserID");
|
|
|
|
|
map.NotNullable(true);
|
|
|
|
|
map.Cascade(Cascade.None);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ManyToOne(x => x.Voucher, map =>
|
|
|
|
|
{
|
|
|
|
|
map.Column("VoucherID");
|
|
|
|
|
map.NotNullable(true);
|
|
|
|
|
map.Cascade(Cascade.None);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-08-23 07:10:05 +00:00
|
|
|
|
}
|