root/UnityWeb/UnityWeb/Repository/NHibernateDataAccess/Mapping/TerritoryMap.cs
| 55 | 56 | ||
|---|---|---|---|
1 | #region Using Statements | 1 | #region Using Statements |
2 | 2 | ||
3 | using System.Xml; | 3 | using System.Xml; |
4 | using Domain.Business; | ||
5 | using Domain.Business.Active; | 4 | using Domain.Business.Active; |
6 | using FluentNHibernate; | 5 | using FluentNHibernate; |
7 | using FluentNHibernate.Mapping; | 6 | using FluentNHibernate.Mapping; |
... | ... | ||
16 | public TerritoryMap() | 15 | public TerritoryMap() |
17 | { | 16 | { |
18 | WithTable("Territories"); | 17 | WithTable("Territories"); |
19 | Id(x => x.Id, "TerritoryID"); | 18 | base.Id(x => x.Id, "TerritoryID"); |
20 | SetAttribute("lazy", "false"); | 19 | base.SetAttribute("lazy", "false"); |
21 | 20 | ||
22 | //non-nullable string with a length of 16 | 21 | //non-nullable string with a length of 16 |
23 | //Map(x => x.).WithLengthOf(16).CanNotBeNull(); | 22 | //Map(x => x.).WithLengthOf(16).CanNotBeNull(); |
24 | 23 | ||
25 | //simple properties | 24 | //simple properties |
26 | Map(x => x.Description, "TerritoryDescription"); | 25 | base.Map(x => x.Description, "TerritoryDescription"); |
27 | 26 | ||
28 | References(x => x.Region, "RegionId") | 27 | base.References(x => x.Region, "RegionId") |
29 | .Cascade.SaveUpdate(); | 28 | .Cascade.SaveUpdate(); |
30 | } | 29 | } |
31 | 30 |
Download diff