@@ -38,28 +38,28 @@ public QueryParameters(IType[] positionalParameterTypes, object[] postionalParam
3838 : this ( positionalParameterTypes , postionalParameterValues , null , collectionKeys ) { }
3939
4040 public QueryParameters ( IType [ ] positionalParameterTypes , object [ ] postionalParameterValues , IDictionary < string , TypedValue > namedParameters , object [ ] collectionKeys )
41- : this ( positionalParameterTypes , postionalParameterValues , namedParameters , null , null , false , false , false , null , null , collectionKeys , null ) { }
41+ : this ( positionalParameterTypes , postionalParameterValues , namedParameters , null , null , false , false , false , null , null , collectionKeys , null , true ) { }
4242
4343 public QueryParameters ( IType [ ] positionalParameterTypes , object [ ] positionalParameterValues , IDictionary < string , LockMode > lockModes , RowSelection rowSelection ,
4444 bool isReadOnlyInitialized , bool readOnly , bool cacheable , string cacheRegion , string comment , bool isLookupByNaturalKey , IResultTransformer transformer )
45- : this ( positionalParameterTypes , positionalParameterValues , null , lockModes , rowSelection , isReadOnlyInitialized , readOnly , cacheable , cacheRegion , comment , null , transformer )
45+ : this ( positionalParameterTypes , positionalParameterValues , null , lockModes , rowSelection , isReadOnlyInitialized , readOnly , cacheable , cacheRegion , comment , null , transformer , true )
4646 {
4747 NaturalKeyLookup = isLookupByNaturalKey ;
4848 }
4949
5050 public QueryParameters ( IDictionary < string , TypedValue > namedParameters , IDictionary < string , LockMode > lockModes , RowSelection rowSelection , bool isReadOnlyInitialized ,
51- bool readOnly , bool cacheable , string cacheRegion , string comment , bool isLookupByNaturalKey , IResultTransformer transformer )
51+ bool readOnly , bool cacheable , string cacheRegion , string comment , bool isLookupByNaturalKey , IResultTransformer transformer , bool canAddCollectionsToCache )
5252 : this (
5353 TypeHelper . EmptyTypeArray , Array . Empty < object > ( ) , namedParameters , lockModes , rowSelection , isReadOnlyInitialized , readOnly , cacheable , cacheRegion , comment , null ,
54- transformer )
54+ transformer , canAddCollectionsToCache )
5555 {
5656 // used by CriteriaTranslator
5757 NaturalKeyLookup = isLookupByNaturalKey ;
5858 }
5959
6060 public QueryParameters ( IType [ ] positionalParameterTypes , object [ ] positionalParameterValues , IDictionary < string , TypedValue > namedParameters ,
6161 IDictionary < string , LockMode > lockModes , RowSelection rowSelection , bool isReadOnlyInitialized , bool readOnly , bool cacheable , string cacheRegion ,
62- string comment , object [ ] collectionKeys , IResultTransformer transformer )
62+ string comment , object [ ] collectionKeys , IResultTransformer transformer , bool canAddCollectionsToCache )
6363 {
6464 PositionalParameterTypes = positionalParameterTypes ?? Array . Empty < IType > ( ) ;
6565 PositionalParameterValues = positionalParameterValues ?? Array . Empty < object > ( ) ;
@@ -73,14 +73,15 @@ public QueryParameters(IType[] positionalParameterTypes, object[] positionalPara
7373 IsReadOnlyInitialized = isReadOnlyInitialized ;
7474 this . readOnly = readOnly ;
7575 ResultTransformer = transformer ;
76+ CanAddCollectionsToCache = canAddCollectionsToCache ;
7677 }
7778
7879 public QueryParameters ( IType [ ] positionalParameterTypes , object [ ] positionalParameterValues , IDictionary < string , TypedValue > namedParameters ,
7980 IDictionary < string , LockMode > lockModes , RowSelection rowSelection , bool isReadOnlyInitialized , bool readOnly , bool cacheable , string cacheRegion ,
8081 string comment , object [ ] collectionKeys , object optionalObject , string optionalEntityName , object optionalId , IResultTransformer transformer )
8182 : this (
8283 positionalParameterTypes , positionalParameterValues , namedParameters , lockModes , rowSelection , isReadOnlyInitialized , readOnly , cacheable , cacheRegion , comment , collectionKeys ,
83- transformer )
84+ transformer , true )
8485 {
8586 OptionalEntityName = optionalEntityName ;
8687 OptionalId = optionalId ;
@@ -138,6 +139,11 @@ public bool HasRowSelection
138139
139140 public bool Callable { get ; set ; }
140141
142+ /// <summary>
143+ /// Indicates if we can add loaded child collections to second lvl cache.
144+ /// </summary>
145+ public bool CanAddCollectionsToCache { get ; set ; }
146+
141147 public bool ReadOnly
142148 {
143149 get
0 commit comments