AdFactum ObjectMapper .NET Blog

Official blog of the AdFactum ObjectMapper .NET

New Release – ObjectMapper .NET 1.1.605.1

Posted by Gerhard Stephan on July 5th, 2006

This release comes up with a lot of smaller changes and some new features.

Beginning with the new features I added a ListAdapter for dotNET 2.0 for a better support of generics. If you query the database with the ObjectMapper .NET you will receive a IList interface as the return value. The new dotNet 2.0 Framework offers no constructor that can handle this native IList interface in order to copy a untyped collection into a typed collection. Using the new ListAdapter a native IList can be converted to a IList<T> class.

            IList myNativeList = mapper.Select(typeof(Contact), null);

 

            IList<Contact> genericList = new List<Contact>(

                new ListAdapter<Contact>(myNativeList)

            );

Furthermore the ObjectMapper .NET has now build in support for a better paging algorithm using the ranking functions of the SQL Server 2005. Thus enables the ObjectMapper .NET to implement a server side paging without loosing performance by seeking the result collection. The paging SQL might look like:

SELECT CONTACT.*  FROM (

      SELECT      CONTACT.* ,

                  ROW_NUMBER() OVER( ORDER BY CONTACT.LASTNAME Asc) as Z_R_N 

      FROM dbo.[CONTACT] ) CONTACT

WHERE Z_R_N BETWEEN 1 AND 10 ;

 

As a third thing I changed the QueryOperator.Like_NoCaseSensitive for the SQL Persister. The old version used TRIM to cut the spacings of the parameter. But this method is unkown to the SQL Server. The new version uses RTRIM which does almost the same.

Last but not least I changed some places where the ToString() method was unnecessarily used and replaced that ToString() method with a strong cast due to improve the performance.

Hope you enjoy the improvements.
Gerhard

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>