AdFactum ObjectMapper .NET Blog

Official blog of the AdFactum ObjectMapper .NET

New Release – ObjectMapper .NET 1.3.814.0

Posted by Gerhard Stephan on September 14th, 2006

The new release covers a lot of new functionality to fit the growing needs of our customers. First of all I changed the connection string used with the SQL Server. That improvement has been suggested by Luis Vargas (see Forum entry).

The next improvement has been made when working with virtual links. Virtual links can now join values from native SQL selects. Thus enables you to bind fields to views or sub selections.

[VirtualLink("SELECT * FROM PRODUCT", typeof(Product), "ProductName", "ProductKey", "ProductKey", "ValidUntil", "@VALIDATION_DATE")]

 

The next big change has been made for unique key fields. Unique keys can now grouped and ordered to build unique key groups. This feature enables you to build combined unique keys.

 

        [PropertyLength(5)]

        [Unique(1)]             // Key Group 1 has been set

        public string Locale

        {

            get { return locale; }

            set { locale = value; }

        }

 

        [PropertyLength(32)]

        [Unique(1)]             // Key Group 1 has been set

        public string Key

        {

            get { return key; }

            set { key = value; }

        }

 

 

As a further change I added business driven foreign keys. Those foreign keys are not compareable with technical foreign keys which can be extracted from the object relations. Business driven foreign keys rely on business logic and business keys (e.g. the combined Unique Keys).

 

    /// <summary>

    /// This class offers translations for a region within a country.

    /// Therefore we must ensure that the country exists in database.

    /// </summary>

    [Table("REGIONS")]

    [ForeignKey("CountryKey", "Locale", typeof(Country), "Key", "Locale")]

    public class CountryRegion : Translation

    {

        private string countryKey;

 

        /// <summary>

        /// Gets or sets the country key.

        /// </summary>

        /// <value>The country key.</value>

        [PropertyLength(32)]

        public string CountryKey

        {

            get { return countryKey; }

            set { countryKey = value; }

        }

 

 

Also a new feature suggested by a customer (see Forum entry) is the possibility to serialize and export the meta data for properties. Therefore I implemented a new class PropertyMetaInfo that holds all informations for a property that can be set by the attributes of the ObjectMapper .NET (e.g. Property Length, Uniqueness etc.). The Meta Informations of a class can be retrieved by calling the ReflectionHelper GetPropertyMetaInfo. The result of this method is serializeable and therefore can used with WebServices to offer the client the possibility to access the meta informations.

 

PropertyMetaInfo[] metaInfos = ReflectionHelper.GetPropertyMetaInfos(typeof(Employee));   

 

Even I solved some more smaller issues, that are the biggest changes in this release.

Hope that you enjoy the new features

 

Cheers

Gerhard Stephan 

 

One Response to “New Release – ObjectMapper .NET 1.3.814.0”

  1. Octav Says:

    Great job, now the framework is lot more friendly in a client-server environment,tx.
    Regards,

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>