Skip to content

Commit 5a807f3

Browse files
committed
Write warning to build log about change of generator kind
1 parent 6077735 commit 5a807f3

File tree

3 files changed

+19
-21
lines changed

3 files changed

+19
-21
lines changed

Orm/Xtensive.Orm/Orm/Building/Builders/TypeBuilder.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -527,6 +527,10 @@ private KeyInfo BuildKeyInfo(TypeInfo root, HierarchyDef hierarchyDef)
527527
}
528528
}
529529

530+
if (generatorKind != hierarchyDef.KeyGeneratorKind && generatorKind == KeyGeneratorKind.None) {
531+
BuildLog.Warning(string.Format(Strings.LogKeyGeneratorKindForHierarchyWithRootXHasChangedToNone, root.Name));
532+
}
533+
530534
if (generatorKind == KeyGeneratorKind.None) {
531535
// No key generator is attached.
532536
// Each hierarchy has it's own equality identifier.

Orm/Xtensive.Orm/Strings.Designer.cs

Lines changed: 12 additions & 21 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Orm/Xtensive.Orm/Strings.resx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2609,4 +2609,7 @@ Error: {1}</value>
26092609
<data name="ExTranslationOfTimeOnlyToStringWithArbitraryArgumentIsNotSupported" xml:space="preserve">
26102610
<value>Translation of TimeOnly.ToString(string) with arbitrary arguments is not supported. Use TimeOnly.ToString("s").</value>
26112611
</data>
2612+
<data name="LogKeyGeneratorKindForHierarchyWithRootXHasChangedToNone" xml:space="preserve">
2613+
<value>Key generator kind for hierarchy with root '{0}' has changed to None. Make sure that all key values are recieved by constructor and passed to one of Entity constructors.</value>
2614+
</data>
26122615
</root>

0 commit comments

Comments
 (0)