Skip to content

Commit cd837d9

Browse files
committed
Renames
1 parent 23cc54c commit cd837d9

14 files changed

Lines changed: 97 additions & 86 deletions

File tree

‎Orm/Xtensive.Orm.Tests/Model/IndexNullsDistinctTest.cs‎

Lines changed: 55 additions & 55 deletions
Large diffs are not rendered by default.

‎Orm/Xtensive.Orm/Orm/Building/Builders/IndexBuilder.cs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -939,11 +939,11 @@ private void BuildFiltersForPartialIndexes()
939939

940940
private void ApplyNullsTreatment(IndexInfo index, IndexDef indexDef)
941941
{
942-
index.IsNullDistinct =
942+
index.AreNullsDistinct =
943943
((index.Attributes & (IndexAttributes.Virtual | IndexAttributes.Primary)) != 0
944-
|| !indexDef.IsNullDistinct.HasValue)
944+
|| !indexDef.AreNullsDistinct.HasValue)
945945
? null
946-
: indexDef.IsNullDistinct;
946+
: indexDef.AreNullsDistinct;
947947
}
948948

949949
#endregion

‎Orm/Xtensive.Orm/Orm/Building/Builders/ModelBuilder.cs‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private void RemoveTemporaryDefinitions()
143143

144144
private void CorrectIndexNullTreatment()
145145
{
146-
// If indexDef.IsNullDistinct becomes public per-index setting,
146+
// If indexDef.ArNullsDistinct becomes public per-index setting,
147147
// this should be implemented as model inspector step with proper fixup actions
148148
// and BuildLog entries for every correction.
149149

@@ -157,12 +157,12 @@ private void CorrectIndexNullTreatment()
157157
if (idx.IsSecondary && idx.IsUnique && settingSupported)
158158
continue;
159159
else
160-
idx.IsNullDistinct = null;
160+
idx.AreNullsDistinct = null;
161161
}
162162
}
163163
else {
164164
foreach (var idx in affectedIndexes) {
165-
idx.IsNullDistinct = null;
165+
idx.AreNullsDistinct = null;
166166
}
167167
}
168168

@@ -174,7 +174,7 @@ static IEnumerable<IndexDef> IndexSelector(TypeDef t)
174174

175175
static bool NotNullFilter(IndexDef i)
176176
{
177-
return i.IsNullDistinct.HasValue;
177+
return i.AreNullsDistinct.HasValue;
178178
}
179179
}
180180

‎Orm/Xtensive.Orm/Orm/Building/Builders/ModelDefBuilder.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ private bool IsFieldAvailable(PropertyInfo property) =>
376376
private void ApplyNullTreatment(IndexDef index)
377377
{
378378
if (index.IsSecondary && index.IsUnique && context.SupportsNullTreatmentOption) {
379-
index.IsNullDistinct = context.Configuration.UniqueNullTreatment switch {
379+
index.AreNullsDistinct = context.Configuration.UniqueNullTreatment switch {
380380
UniqueNullTreatment.Distinct => true,
381381
UniqueNullTreatment.NotDistinct => false,
382382
_ => null

‎Orm/Xtensive.Orm/Orm/Building/Definitions/IndexDef.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public LambdaExpression FilterExpression
154154

155155
internal bool IsInherited { get; set; }
156156

157-
internal bool? IsNullDistinct { get; set; }
157+
internal bool? AreNullsDistinct { get; set; }
158158

159159
/// <summary>
160160
/// Performs additional custom processes before setting new name to this instance.

‎Orm/Xtensive.Orm/Orm/Model/IndexInfo.cs‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ public bool IsClustered
279279
get => (attributes & IndexAttributes.Clustered) > 0;
280280
}
281281

282-
internal bool? IsNullDistinct { get; set; }
282+
internal bool? AreNullsDistinct { get; set; }
283283

284284
/// <inheritdoc/>
285285
public override void UpdateState()
@@ -394,7 +394,7 @@ public IndexInfo(TypeInfo reflectedType, IndexAttributes indexAttributes, IndexI
394394
DeclaringIndex = ancestorIndex.DeclaringIndex;
395395
shortName = ancestorIndex.ShortName;
396396
if (!IsVirtual && IsSecondary)
397-
IsNullDistinct = ancestorIndex.IsNullDistinct;
397+
AreNullsDistinct = ancestorIndex.AreNullsDistinct;
398398

399399
if (addAncestorToUnderlyings) {
400400
UnderlyingIndexes.Add(ancestorIndex);

‎Orm/Xtensive.Orm/Orm/Upgrade/Internals/DomainExtractedModelBuilder.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ private void CreateSecondaryIndex(Table table, SecondaryIndexInfo indexInfo)
158158
var index = table.CreateIndex(indexInfo.Name);
159159
index.IsUnique = indexInfo.IsUnique;
160160
index.IsClustered = indexInfo.IsClustered;
161-
index.NullTreatment = indexInfo.NullDistinct switch {
161+
index.NullTreatment = indexInfo.AreNullsDistinct switch {
162162
null => Sql.Model.UniqueNullTreatment.Unspecified,
163163
true => Sql.Model.UniqueNullTreatment.Distinct,
164164
false => Sql.Model.UniqueNullTreatment.NotDistinct

‎Orm/Xtensive.Orm/Orm/Upgrade/Internals/DomainModelConverter.cs‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,21 +154,21 @@ private void VisitIndexInfo(IndexInfo primaryIndex, IndexInfo index)
154154
secondaryIndex.IsUnique = index.IsUnique;
155155
var isClustered = index.IsClustered && providerInfo.Supports(ProviderFeatures.ClusteredIndexes);
156156
secondaryIndex.IsClustered = isClustered;
157-
secondaryIndex.NullDistinct = index.IsNullDistinct;
157+
secondaryIndex.AreNullsDistinct = index.AreNullsDistinct;
158158

159159
if (index.IsUnique && providerInfo.Supports(ProviderFeatures.UniqueNullTreatment)) {
160-
// If storage supports SQL 2023 unique nulls treatment, but no value set for NullDistinct
160+
// If storage supports SQL 2023 unique nulls treatment, but no value set for AreNullsDistinct
161161
// it means default settings are used in domain configuration, and we should try to resolve it
162162
// into default treatment for storage via driver to not have changes on models comparison.
163163
// We expect that default behaviour will be defined as either distinct or not distinct.
164-
if (!secondaryIndex.NullDistinct.HasValue)
165-
secondaryIndex.NullDistinct = driver.ServerInfo.Index.NullDistinctByDefault;
164+
if (!secondaryIndex.AreNullsDistinct.HasValue)
165+
secondaryIndex.AreNullsDistinct = driver.ServerInfo.Index.NullDistinctByDefault;
166166
}
167-
else if (secondaryIndex.NullDistinct.HasValue) {
167+
else if (secondaryIndex.AreNullsDistinct.HasValue) {
168168
// Should never happen, if so then something is wrong with model building.
169169
// If null treatment option ever becomes public per-index setting
170170
// then an exception should be thrown here, but now we late-fix value to correct one.
171-
secondaryIndex.NullDistinct = null;
171+
secondaryIndex.AreNullsDistinct = null;
172172
}
173173

174174
foreach (KeyValuePair<ColumnInfo, Direction> pair in index.KeyColumns) {

‎Orm/Xtensive.Orm/Orm/Upgrade/Internals/SqlActionTranslator.cs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1073,7 +1073,7 @@ private Index CreateSecondaryIndex(Table table, SecondaryIndexInfo indexInfo)
10731073
var index = table.CreateIndex(indexInfo.Name);
10741074
index.IsUnique = indexInfo.IsUnique;
10751075
index.IsClustered = indexInfo.IsClustered;
1076-
index.NullTreatment = indexInfo.NullDistinct switch {
1076+
index.NullTreatment = indexInfo.AreNullsDistinct switch {
10771077
null => Sql.Model.UniqueNullTreatment.Unspecified,
10781078
true => Sql.Model.UniqueNullTreatment.Distinct,
10791079
false => Sql.Model.UniqueNullTreatment.NotDistinct

‎Orm/Xtensive.Orm/Orm/Upgrade/Internals/SqlModelConverter.cs‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,14 +189,13 @@ protected override SecondaryIndexInfo VisitIndex(Index index)
189189
if (index.IsUnique && nullTreatmentSupported) {
190190
// if option is supported then there is no such thing as unspecified treatment,
191191
// index has to have either 'distinct' or 'not distinct' null treatment
192-
secondaryIndexInfo.NullDistinct = index.NullTreatment == Sql.Model.UniqueNullTreatment.Distinct;
192+
secondaryIndexInfo.AreNullsDistinct = index.NullTreatment == Sql.Model.UniqueNullTreatment.Distinct;
193193
}
194194
else {
195195
// for non unique indexes or if no support - index should have null
196-
secondaryIndexInfo.NullDistinct = null;
196+
secondaryIndexInfo.AreNullsDistinct = null;
197197
}
198198

199-
200199
foreach (var keyColumn in index.Columns) {
201200
var columnInfo = tableInfo.Columns[keyColumn.Column.Name];
202201
_ = new KeyColumnRef(secondaryIndexInfo,

0 commit comments

Comments
 (0)