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

Problem with horizontal inheritance

1 Answer 104 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Christian
Top achievements
Rank 1
Christian asked on 03 Mar 2010, 03:38 PM
Hi,
I have an abstract base class and then define the key. I can't do the horizontal inheritance. I get the following error message:

Fehler 3 OpenAccess Error: Telerik.OpenAccess: Updating SQL schema failed. Unknown inheritance strategy: 3 for Berlin.Polizei.INGO.Daten.Basis.Adresse Polizei.Berlin.INGO.Daten.Basis   
 

If I turn off the update of the database, there is no error message.

Here ist my app.config:
<?xml version="1.0"?>  
 
<configuration> 
 
<configSections> 
 
<section name="openaccess" type="Telerik.OpenAccess.Config.ConfigSectionHandler, Telerik.OpenAccess.Config, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7ce17eeaf1d59342" requirePermission="false" /> 
 
</configSections> 
 
<openaccess xmlns="http://www.telerik.com/OpenAccess">  
 
<references /> 
 
<connections> 
 
<connection id="INGO_TEST">  
 
<databasename>INGO_TEST001</databasename> 
 
<servername>map-sql-0120</servername> 
 
<integratedSecurity>False</integratedSecurity> 
 
<user>INGO_TEST_Admin</user> 
 
<password>ingo123</password> 
 
<backendconfigurationname>mssqlConfiguration</backendconfigurationname> 
 
</connection> 
 
</connections> 
 
<backendconfigurations> 
 
<backendconfiguration id="mssqlConfiguration" backend="mssql">  
 
<managedManyToMany>True</managedManyToMany> 
 
<managedOneToMany>True</managedOneToMany> 
 
<ext.db-inheritance>horizontal</ext.db-inheritance> 
 
<logging.logEvents>none</logging.logEvents> 
 
<l2CacheEnabled>True</l2CacheEnabled> 
 
<mappingname>mssqlMapping</mappingname> 
 
</backendconfiguration> 
 
</backendconfigurations> 
 
<mappings current="mssqlMapping">  
 
<mapping id="mssqlMapping">  
 
</mapping> 
 
</mappings> 
 
</openaccess> 
 
</configuration> 
 

My base class has the following source code:
using System;  
using Telerik.OpenAccess;  
 
namespace Polizei.Berlin.INGO.Daten.Basis  
{  
    [Persistent(IdentityField = "id")]  
    public abstract class MetaDaten   
    {  
        public MetaDaten()  
        {  
        }  
 
        protected Guid id ;  
 
        [FieldAlias("id")]  
        public Guid ID  
        {  
            get { return id; }  
            set { id = value; }  
        }  
 
        private string bezeichnung;  
 
        [FieldAlias("bezeichnung")]  
        public string Bezeichnung  
        {  
            get { return bezeichnung; }  
            set { bezeichnung = value; }  
        }  
 
        private DateTime aenderung;  
        [FieldAlias("aenderung")]  
        public DateTime Aenderung  
        {  
            get { return aenderung; }  
            set { aenderung = value; }  
        }  
 
        private DateTime erstellungsdatum;  
 
        [FieldAlias("erstellungsdatum")]  
        public DateTime Erstellungsdatum  
        {  
            get { return erstellungsdatum; }  
            set { erstellungsdatum = value; }  
        }  
    }  
}  
 
 And a last my adress-class:
using Polizei.Berlin.INGO.Daten.Basis;  
using Telerik.OpenAccess;  
 
 
namespace Berlin.Polizei.INGO.Daten.Basis  
{  
    [Persistent]  
    public class Adresse : MetaDaten  
    {  
        public  Adresse()  
        {  
        }  
 
        private string strasse;  
        private string hausnummer;  
        private string plz;  
        private string ort;  
        private string geoKorordinate;  
 
 
 
        [FieldAlias("strasse")]  
        public string Strasse  
        {  
            get { return strasse; }  
            set { strasse = value; }  
        }  
        [FieldAlias("hausnummer")]  
        public string Hausnummer  
        {  
            get { return hausnummer; }  
            set { hausnummer = value; }  
        }  
        [FieldAlias("plz")]  
        public string Plz  
        {  
            get { return plz; }  
            set { plz = value; }  
        }  
        [FieldAlias("ort")]  
        public string Ort  
        {  
            get { return this.ort; }  
            set { this.ort = value; }  
        }  
        [FieldAlias("geoKorordinate")]  
        public string GeoKorordinate  
        {  
            get { return geoKorordinate; }  
            set { geoKorordinate = value; }  
        }  
    }  
}  
 

If I try to start the wizard the system produce the following error message:

Fehler 3 OpenAccess: System.NullReferenceException: Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt.  
   bei OpenAccessRuntime.Relational.metadata.RelationalClass.SetupInMemoryHandling()  
   bei OpenAccessRuntime.metadata.ClassMetaData.SetupInMemoryHandling()  
   bei OpenAccessRuntime.metadata.MetaDataBuilder.SetupInMemoryHandling(ClassMetaData[] classes)  
   bei OpenAccessRuntime.metadata.MetaDataBuilder.buildMetaData(DataObjectsRoot[] roots, Boolean ignoreNoClasses)  
   bei OpenAccessRuntime.Relational.RelationalMetaDataBuilder.buildMetaData(DataObjectsRoot[] roots, Boolean ignoreNoClasses)  
   bei OpenAccessRuntime.Relational.RelationalStorageManagerFactory..ctor(StorageManagerFactoryBuilder b)  
   bei OpenAccessRuntime.storagemanager.StorageManagerFactoryBuilder.createSmfForURL()    
 


I use VS 2008 and the lastet version of your components.
For help would be appreciated.

Christian

1 Answer, 1 is accepted

Sort by
0
Accepted
Jan Blessenohl
Telerik team
answered on 03 Mar 2010, 08:36 PM
Hi Christian,
It is not a good idea to specify the horizontal mapping as global strategy. Please specify it directly at the MetaDaten class. The identity mechanism must be specified at the derived class. The forward mapping wizard should work in that case.

Best wishes,
Jan Blessenohl
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Design Time (Visual Designer & Tools)
Asked by
Christian
Top achievements
Rank 1
Answers by
Jan Blessenohl
Telerik team
Share this question
or