in the MetaClass Attributes element:
<
MetaProperty
Id
=
"2a03bd86-978a-439a-9deb-27c144e419e9"
Name
=
"ID"
accessModifier
=
"Public"
inheritanceModifier
=
"None"
Type
=
"Int32"
label
=
"ID : Int32"
kind
=
"Default"
nullable
=
"false"
hasGetter
=
"false"
hasSetter
=
"false"
identity
=
"true"
isNavigable
=
"false"
loadBehavior
=
"Default"
/>
in the orm:class element:
<
orm:identity
>
<
orm:key-generator
name
=
"autoinc"
/>
<
orm:single-field
field-name
=
"ID1"
/>
</
orm:identity
>
I don't see anywhere how this is perceived as a internal identity field, which is the error message (Telerik.OpenAccess.Runtime Class 'ClassNameHERE' uses internal identity but has a pk field 'ID1'.) I get at runtime when I try to setup the schema or do any context create/query. I've been struggling with this for a while... can you help? Thanks!
8 Answers, 1 is accepted
This is something that another one of our customers reported and we did not have the luck to reproduce it on our side. If it is not too much trouble can you send us your project so that we can debug it locally or assemble a sample project that shows this kind of behavior. Your collaboration on this one will be highly appreciated as we are also very keen on fixing this bug for good.
We are looking forward to resolving this issue, however we will need your help to do so.
Serge
the Telerik team
I found the problem by comparing my production project with the code community project I just submitted (MyORM). It has to do with the code generation method. If you select a Mapping type of 'Attributes' instead of the default 'Xml', you get this problem. Making the one line change in either the .rlinq file or using the model context menu choice 'Show Model settings...', tab 'Code Generation Settings', dropdown 'Mapping type:', to 'Xml'.
Before:
<
CodeGenerationSettings
>
<
ShouldGenerateContext
>true</
ShouldGenerateContext
>
<
OutputProjectName
>MyORM</
OutputProjectName
>
<
OutputProjectFolder
>\Generated\</
OutputProjectFolder
>
<
OutputPath
>Generated\</
OutputPath
>
<
UseCustomTemplate
>false</
UseCustomTemplate
>
<
MappingDefinitionType
>Attributes</
MappingDefinitionType
>
<
GenerateMultipleFiles
>true</
GenerateMultipleFiles
>
<
OverrideToAutoProperties
>true</
OverrideToAutoProperties
>
<
OutputMode
>ProjectFolder</
OutputMode
>
</
CodeGenerationSettings
>
After:
<
CodeGenerationSettings
>
<
ShouldGenerateContext
>true</
ShouldGenerateContext
>
<
OutputProjectName
>MyORM</
OutputProjectName
>
<
OutputProjectFolder
>\Generated\</
OutputProjectFolder
>
<
OutputPath
>Generated\</
OutputPath
>
<
UseCustomTemplate
>false</
UseCustomTemplate
>
<
MappingDefinitionType
>Xml</
MappingDefinitionType
>
<
GenerateMultipleFiles
>true</
GenerateMultipleFiles
>
<
OverrideToAutoProperties
>true</
OverrideToAutoProperties
>
<
OutputMode
>ProjectFolder</
OutputMode
>
</
CodeGenerationSettings
>
I am glad that you have found a solution to your problem. Unfortunately this means that there is a bug present in our Attributes Mapping that is left unresolved. Please do find you Telerik point updated.
One last thing - if you were to send us a solution that we could use to reproduce this problem it would be greatly appreciated by us and by the community.
Again I am glad you solved your problem.
Serge
the Telerik team
This appeared to be caused by a bug in our attributes mapping which is exposed by using horizontal inheritance strategy as you have in your project. This was really helpful from your side in order for us to locate and fix this bug, so you can find your Telerik points updated. The fix will be part of the next internal build which we plan to release in the following week or for the upcoming Q3 release the latest.
Kind regards,Zoran
the Telerik team
I get the same error message. My class has an pk-field with the name 'ID' of type GUID. I use the ORM version 1125.1.
The rlinq-file contains the following part:
<
MetaClass
Id
=
"b107507d-e8a6-4fbd-a8f2-6a2dbfcb9bbe"
Name
=
"clsAMOKObjekt"
namespace
=
"Berlin.Polizei.INGO.Klassenbibliothek"
accessModifier
=
"Public"
Kind
=
"Default"
doubleDerived
=
"false"
cachePolicy
=
"Default"
identityMechanism
=
"BackendCalculated"
concurrencyMode
=
"Default"
concurrencyMember
=
"(AUTO)"
updateSchema
=
"true"
>
<
Attributes
>
<
MetaProperty
Id
=
"0e148e69-1de8-4327-ba93-7d7f41238c0a"
Name
=
"Voaversion"
accessModifier
=
"Public"
inheritanceModifier
=
"None"
Type
=
"Int16"
label
=
"Voaversion : Int16"
kind
=
"Default"
nullable
=
"false"
hasGetter
=
"true"
hasSetter
=
"true"
identity
=
"false"
isNavigable
=
"false"
loadBehavior
=
"Default"
/>
<
MetaProperty
Id
=
"c7cda339-8127-4ad1-b1a5-a7596a2b92b7"
Name
=
"Id"
accessModifier
=
"Public"
inheritanceModifier
=
"None"
Type
=
"Guid"
label
=
"Id : Guid"
kind
=
"Default"
nullable
=
"false"
hasGetter
=
"true"
hasSetter
=
"true"
identity
=
"true"
isNavigable
=
"false"
loadBehavior
=
"Default"
/>
<
MetaProperty
Id
=
"7c131fcc-9447-4167-8e0b-ea3d8414e1f4"
Name
=
"ZugeordGrundObjekt"
accessModifier
=
"Public"
inheritanceModifier
=
"None"
Type
=
"Guid"
label
=
"ZugeordGrundObjekt : Guid"
kind
=
"Default"
nullable
=
"true"
hasGetter
=
"true"
hasSetter
=
"true"
identity
=
"false"
isNavigable
=
"false"
loadBehavior
=
"Default"
/>
<
MetaProperty
Id
=
"54a3b00b-1f18-441f-9391-b600b33addbe"
Name
=
"GrundObjektList"
accessModifier
=
"Public"
inheritanceModifier
=
"None"
Type="IList<clsGrundObjektInformation>" label="GrundObjektList : IList<
clsGrundObjektInformation
>" kind="Default" nullable="true" hasGetter="true" hasSetter="true" identity="false" isNavigable="true" loadBehavior="Default" />
</
Attributes
>
<
implementedProperties
>
<
classHasImplementedProperties
Id
=
"bd39c09a-b9fa-4a83-bef0-d44fc919ab4f"
>
<
implementedMetaProperty
Id
=
"58248ed1-699d-4298-b55b-6a92c8c028ea"
Name
=
"Autor"
accessModifier
=
"Public"
inheritanceModifier
=
"None"
label
=
"Autor : String"
kind
=
"Default"
nullable
=
"false"
hasGetter
=
"false"
hasSetter
=
"false"
identity
=
"false"
isNavigable
=
"false"
loadBehavior
=
"Default"
/>
</
classHasImplementedProperties
>
<
classHasImplementedProperties
Id
=
"eafa72fe-1649-4c7e-8f30-650241abbc0f"
>
<
implementedMetaProperty
Id
=
"4e430e7a-7cb6-404e-9ba8-103e55fd1499"
Name
=
"LastUpdate"
accessModifier
=
"Public"
inheritanceModifier
=
"None"
Type
=
"DateTime"
label
=
"LastUpdate : DateTime"
kind
=
"Default"
nullable
=
"false"
hasGetter
=
"false"
hasSetter
=
"false"
identity
=
"false"
isNavigable
=
"false"
loadBehavior
=
"Default"
/>
</
classHasImplementedProperties
>
<
classHasImplementedProperties
Id
=
"cbd32374-c978-4109-9745-e5059b104e6e"
>
<
implementedMetaProperty
Id
=
"9a49e06d-d9db-4ec8-83fa-37cf9a4ebeac"
Name
=
"CreateDate"
accessModifier
=
"Public"
inheritanceModifier
=
"None"
Type
=
"DateTime"
label
=
"CreateDate : DateTime"
kind
=
"Default"
nullable
=
"false"
hasGetter
=
"false"
hasSetter
=
"false"
identity
=
"false"
isNavigable
=
"false"
loadBehavior
=
"Default"
/>
</
classHasImplementedProperties
>
</
implementedProperties
>
</
MetaClass
>
What must I do to to avoid the error message?
Kind regards
Christian
I believe that the workaround for you would be to switch to using Xml mapping in your .rlinq model. At the moment we are having some problems with reading the metadata from the Clr attributes and using Xml should not change anything in your experience with the product.
Zoran
the Telerik team