This question is locked. New answers and comments are not allowed.
Hi
I'm trying to set up a reference to a class with a composite key for which one of the primary fields is inherited. One specific example:
- Class Country_Audit has composite primary key with fields
- int entityID, defined by itself, DB column is CountryID
- int lockVersion, defined by superclass AuditLogEntry (in the same assembly), DB column is LockVersion
- Class Country has a reference Country_Audit latestAuditLogEntry with the mapping:
When I run this, I get an exception:
Telerik.OpenAccess.Exceptions.MetadataException : The field 'latestAuditLogEntry' of class 'MSW.MAPS.Testbed.Domain.Country' references a primary key field 'lockVersion' of class 'MSW.MAPS.Testbed.Domain.Country+Country_Audit' that could not be found. --> C:\Users\PeterW\AppData\Local\Temp\nunit20\ShadowCopyCache\8800_634540394140613784\Tests_1156102583\assembly\dl3\d8958bc2\f06f97d1_0089cc01\MSW.MAPS.Testbed.Domain.DLL:(resource)MSW.MAPS.Testbed.Domain.App.config:mapping-id=mssqlMapping/namespace[MSW.MAPS.Testbed.Domain]/class[Country]/field[latestAuditLogEntry]/db-ref="lockVersion"
I know from replies to previous posts that OpenAccess has limitations with fields from superclasses (especially when they're in different assemblies); is this another case of that, or have I done something wrong?
Thanks, Peter
I'm trying to set up a reference to a class with a composite key for which one of the primary fields is inherited. One specific example:
- Class Country_Audit has composite primary key with fields
- int entityID, defined by itself, DB column is CountryID
- int lockVersion, defined by superclass AuditLogEntry (in the same assembly), DB column is LockVersion
- Class Country has a reference Country_Audit latestAuditLogEntry with the mapping:
<
field
name
=
"latestAuditLogEntry"
>
<
extension
key
=
"db-ref"
value
=
"entityID"
>
<
extension
key
=
"db-column-name"
value
=
"CountryID"
/>
</
extension
>
<
extension
key
=
"db-ref"
value
=
"lockVersion"
>
<
extension
key
=
"db-column-name"
value
=
"LockVersion"
/>
</
extension
>
</
field
>
When I run this, I get an exception:
Telerik.OpenAccess.Exceptions.MetadataException : The field 'latestAuditLogEntry' of class 'MSW.MAPS.Testbed.Domain.Country' references a primary key field 'lockVersion' of class 'MSW.MAPS.Testbed.Domain.Country+Country_Audit' that could not be found. --> C:\Users\PeterW\AppData\Local\Temp\nunit20\ShadowCopyCache\8800_634540394140613784\Tests_1156102583\assembly\dl3\d8958bc2\f06f97d1_0089cc01\MSW.MAPS.Testbed.Domain.DLL:(resource)MSW.MAPS.Testbed.Domain.App.config:mapping-id=mssqlMapping/namespace[MSW.MAPS.Testbed.Domain]/class[Country]/field[latestAuditLogEntry]/db-ref="lockVersion"
I know from replies to previous posts that OpenAccess has limitations with fields from superclasses (especially when they're in different assemblies); is this another case of that, or have I done something wrong?
Thanks, Peter