@@ -30,15 +30,10 @@ public class ClassMap<T> : ClasslikeMapBase<T>, IMappingProvider
30
30
{
31
31
protected readonly AttributeStore attributes ;
32
32
readonly MappingProviderStore providers ;
33
- readonly OptimisticLockBuilder < ClassMap < T > > optimisticLock ;
34
33
35
34
readonly IList < ImportPart > imports = new List < ImportPart > ( ) ;
36
35
bool nextBool = true ;
37
36
38
- readonly HibernateMappingPart hibernateMappingPart = new HibernateMappingPart ( ) ;
39
- readonly PolymorphismBuilder < ClassMap < T > > polymorphism ;
40
- readonly SchemaActionBuilder < ClassMap < T > > schemaAction ;
41
-
42
37
public ClassMap ( )
43
38
: this ( new AttributeStore ( ) , new MappingProviderStore ( ) )
44
39
{ }
@@ -48,9 +43,9 @@ protected ClassMap(AttributeStore attributes, MappingProviderStore providers)
48
43
{
49
44
this . attributes = attributes ;
50
45
this . providers = providers ;
51
- optimisticLock = new OptimisticLockBuilder < ClassMap < T > > ( this , value => attributes . Set ( "OptimisticLock" , Layer . UserSupplied , value ) ) ;
52
- polymorphism = new PolymorphismBuilder < ClassMap < T > > ( this , value => attributes . Set ( "Polymorphism" , Layer . UserSupplied , value ) ) ;
53
- schemaAction = new SchemaActionBuilder < ClassMap < T > > ( this , value => attributes . Set ( "SchemaAction" , Layer . UserSupplied , value ) ) ;
46
+ OptimisticLock = new OptimisticLockBuilder < ClassMap < T > > ( this , value => attributes . Set ( "OptimisticLock" , Layer . UserSupplied , value ) ) ;
47
+ Polymorphism = new PolymorphismBuilder < ClassMap < T > > ( this , value => attributes . Set ( "Polymorphism" , Layer . UserSupplied , value ) ) ;
48
+ SchemaAction = new SchemaActionBuilder < ClassMap < T > > ( this , value => attributes . Set ( "SchemaAction" , Layer . UserSupplied , value ) ) ;
54
49
Cache = new CachePart ( typeof ( T ) ) ;
55
50
}
56
51
@@ -69,10 +64,7 @@ protected ClassMap(AttributeStore attributes, MappingProviderStore providers)
69
64
/// <example>
70
65
/// HibernateMapping.Schema("dto");
71
66
/// </example>
72
- public HibernateMappingPart HibernateMapping
73
- {
74
- get { return hibernateMappingPart ; }
75
- }
67
+ public HibernateMappingPart HibernateMapping { get ; } = new HibernateMappingPart ( ) ;
76
68
77
69
#region Ids
78
70
@@ -427,26 +419,17 @@ public ClassMap<T> BatchSize(int size)
427
419
/// <summary>
428
420
/// Sets the optimistic locking strategy
429
421
/// </summary>
430
- public OptimisticLockBuilder < ClassMap < T > > OptimisticLock
431
- {
432
- get { return optimisticLock ; }
433
- }
422
+ public OptimisticLockBuilder < ClassMap < T > > OptimisticLock { get ; }
434
423
435
424
/// <summary>
436
425
/// Sets the polymorphism behaviour
437
426
/// </summary>
438
- public PolymorphismBuilder < ClassMap < T > > Polymorphism
439
- {
440
- get { return polymorphism ; }
441
- }
427
+ public PolymorphismBuilder < ClassMap < T > > Polymorphism { get ; }
442
428
443
429
/// <summary>
444
430
/// Sets the schema action behaviour
445
431
/// </summary>
446
- public SchemaActionBuilder < ClassMap < T > > SchemaAction
447
- {
448
- get { return schemaAction ; }
449
- }
432
+ public SchemaActionBuilder < ClassMap < T > > SchemaAction { get ; }
450
433
451
434
/// <summary>
452
435
/// Specifies a check constraint
@@ -689,7 +672,7 @@ ClassMapping IMappingProvider.GetClassMapping()
689
672
690
673
HibernateMapping IMappingProvider . GetHibernateMapping ( )
691
674
{
692
- var hibernateMapping = ( ( IHibernateMappingProvider ) hibernateMappingPart ) . GetHibernateMapping ( ) ;
675
+ var hibernateMapping = ( ( IHibernateMappingProvider ) HibernateMapping ) . GetHibernateMapping ( ) ;
693
676
694
677
foreach ( var import in imports )
695
678
hibernateMapping . AddImport ( import . GetImportMapping ( ) ) ;
0 commit comments