Problem with horizontal inheritance

2 posts, 1 answers
  1. Christian
    Christian avatar
    81 posts
    Member since:
    Aug 2008

    Posted 03 Mar 2010 Link to this post

    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

  2. Answer
    Jan Blessenohl
    Admin
    Jan Blessenohl avatar
    707 posts

    Posted 03 Mar 2010 Link to this post

    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.
  3. DevCraft banner
Back to Top