2024-05-16 00:42:06 +02:00
|
|
|
|
using FluentNHibernate.Mapping;
|
|
|
|
|
|
|
|
|
|
namespace FirmTracker_Server.nHibernate.Transactions
|
|
|
|
|
{
|
|
|
|
|
public class Transaction2Mapping : ClassMap<Transaction2>
|
|
|
|
|
{
|
|
|
|
|
public Transaction2Mapping()
|
|
|
|
|
{
|
|
|
|
|
Table("Transactions");
|
|
|
|
|
Id(x => x.Id).GeneratedBy.Identity();
|
|
|
|
|
Map(x => x.Date);
|
|
|
|
|
Map(x => x.EmployeeId);
|
|
|
|
|
Map(x => x.PaymentType);
|
|
|
|
|
Map(x => x.Discount);
|
|
|
|
|
Map(x => x.Description);
|
|
|
|
|
|
|
|
|
|
HasMany(x => x.TransactionProducts)
|
|
|
|
|
.KeyColumn("TransactionId")
|
|
|
|
|
.Cascade.AllDeleteOrphan()
|
|
|
|
|
.Inverse(); // Ustawienie Inverse() wskazuje, że to `TransactionProduct` jest właścicielem relacji
|
2024-06-08 00:24:12 +02:00
|
|
|
|
|
2024-05-16 00:42:06 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|