@@ -13,7 +13,7 @@ namespace NHibernate.Mapping
13
13
/// <see cref="Subclass"/> that is mapped by <c><subclass></c> or
14
14
/// <c><joined-subclass></c>.
15
15
/// </summary>
16
- public abstract class PersistentClass : IFilterable
16
+ public abstract class PersistentClass : IFilterable , IMetaAttributable
17
17
{
18
18
private static readonly Alias PKAlias = new Alias ( 15 , "PK" ) ;
19
19
@@ -36,7 +36,7 @@ public abstract class PersistentClass : IFilterable
36
36
private int batchSize = 1 ;
37
37
private bool selectBeforeUpdate ;
38
38
private OptimisticLockMode optimisticLockMode ;
39
- private IDictionary metaAttributes ;
39
+ private IDictionary < string , MetaAttribute > metaAttributes ;
40
40
private readonly List < Join > joins = new List < Join > ( ) ;
41
41
private readonly List < Join > subclassJoins = new List < Join > ( ) ;
42
42
private readonly IDictionary < string , string > filters = new Dictionary < string , string > ( ) ;
@@ -63,6 +63,8 @@ public abstract class PersistentClass : IFilterable
63
63
private bool hasSubselectLoadableCollections ;
64
64
private string entityName ;
65
65
66
+ private IDictionary < EntityMode , System . Type > tuplizerImpls ;
67
+
66
68
/// <summary>
67
69
/// Gets or Sets if the Insert Sql is built dynamically.
68
70
/// </summary>
@@ -525,15 +527,15 @@ public bool IsDiscriminatorValueNull
525
527
get { return NullDiscriminatorMapping . Equals ( DiscriminatorValue ) ; }
526
528
}
527
529
528
- public IDictionary MetaAttributes
530
+ public IDictionary < string , MetaAttribute > MetaAttributes
529
531
{
530
532
get { return metaAttributes ; }
531
533
set { metaAttributes = value ; }
532
534
}
533
535
534
536
public MetaAttribute GetMetaAttribute ( string name )
535
537
{
536
- return ( MetaAttribute ) metaAttributes [ name ] ;
538
+ return metaAttributes [ name ] ;
537
539
}
538
540
539
541
public virtual IEnumerable < Join > JoinIterator
@@ -945,5 +947,32 @@ public virtual bool HasIdentifierMapper
945
947
get { return identifierMapper != null ; }
946
948
}
947
949
950
+ public void AddTuplizer ( EntityMode entityMode , System . Type implClass )
951
+ {
952
+ if ( tuplizerImpls == null )
953
+ {
954
+ tuplizerImpls = new Dictionary < EntityMode , System . Type > ( ) ;
955
+ }
956
+ tuplizerImpls [ entityMode ] = implClass ;
957
+ }
958
+
959
+ public virtual System . Type GetTuplizerImplClassName ( EntityMode mode )
960
+ {
961
+ if ( tuplizerImpls == null )
962
+ return null ;
963
+ return tuplizerImpls [ mode ] ;
964
+ }
965
+
966
+ public virtual IDictionary < EntityMode , System . Type > TuplizerMap
967
+ {
968
+ get
969
+ {
970
+ if ( tuplizerImpls == null )
971
+ return null ;
972
+
973
+ return new Dictionary < EntityMode , System . Type > ( tuplizerImpls ) ;
974
+ }
975
+
976
+ }
948
977
}
949
978
}
0 commit comments