This is a migrated thread and some comments may be shown as answers.

Vanatec OpenAccess migration

1 Answer 65 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Roman
Top achievements
Rank 1
Roman asked on 15 Apr 2009, 08:05 AM
Hi

I'm trying to migrate a project from Visual Studio 2005 to 2008.

Therefore I replaced the Vanatec OpenAccess with the lastet Telerik OpenAccess build and did all the steps from the article "Moving form Vanatec to Telerik OpenAccess".

When I try to run my program I get the following exception:

Class 'Astra.Mistra.Vmon.Common.DataModel.Persistence.Calendar' uses internal identity but has a pk field 'id'. --> DataModel, Version=1.1.3.0, Culture=neutral, PublicKeyToken=null/namespace[Astra.Mistra.Vmon.Common.DataModel.Persistence]/class[Astra.Mistra.Vmon.Common.DataModel.Persistence.Calendar]

The class is declared as

[

Persistent(IdentityField = "id")]

 

 

public class Calendar : VersionableObject

 

{

    ...
}

The code runs with the same mapping under Vantec OpenAccess, any idea?

When I try to change the mapping and open therefore  the "Forward Mapping" dialog, it opens, but when I try to select one of the persistent classes I get the following exception:

Exception: Key cannot be null.

 

Parameter name: key

Generated by the method:

System.Object get_Item(System.Object)

 

Stack Trace:

at System.Collections.Hashtable.get_Item(Object key)

 

at OpenAccessRuntime.DataObjects.tools.workbench.model.MdClass.setFetchGroupMapping()

at OpenAccessRuntime.DataObjects.tools.workbench.model.MdClass.analyze(Boolean notifyDatastore)

at OpenAccessRuntime.DataObjects.tools.workbench.model.MdProject.analyzeAllClasses()

at OpenAccessRuntime.DataObjects.tools.workbench.model.MdProject.syncAllClassesAndInterfaces()

at OpenAccessRuntime.DataObjects.tools.workbench.model.MdProject.load(IMappingData[] _mappingData, IDictionary _configProps)

at Telerik.OpenAccess.Sdk.Addin.UserControls.MdProjectHelper.CreateMdProject(VAProject project)

at Telerik.OpenAccess.Sdk.Addin.UserControls.MdProjectHelper.GetMdProject(VAProject project)

at Telerik.OpenAccess.Sdk.Addin.UserControls.PersistentUserControl.ActivateUserControl(VAProject actualProject)

at Telerik.OpenAccess.Sdk.Addin.UserControls.ClassViewControl.classTreeView_AfterSelect(Object sender, TreeViewEventArgs e)

Exception Type:

System.ArgumentNullException

 


Is there something I have to remove/change from the existing "Vanatec" mapping?

Thanks for your input!

Roman


1 Answer, 1 is accepted

Sort by
0
Jan Blessenohl
Telerik team
answered on 16 Apr 2009, 04:19 PM
Hello Roman,
If the id field is in the base class you have to prepend it with the base class name. Can you please try:

[Persistent(IdentityField = "VersionableObject.id")]

Greetings,
Jan Blessenohl
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
General Discussions
Asked by
Roman
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Share this question
or