The ObjectMapper .NET Project

Official blog of the AdFactum ObjectMapper .NET

Archive for January, 2008

New Release – AdFactum ObjectMapper .NET 2.2.2430.0

Posted by Gerhard Stephan on 30th January 2008

This version contains two new changes.

The first, is included because of the backward compatibility to earlier versions where the AdFactum ObjectMapper .NET did only support GUID types as Primary Keys. To satisfy our customers which upgraded to the new version the last days, I included a backward compatibility modus. The rule: If no primary key is defined within an interface, assume that the primary key must be a GUID.

The second new feature is a new overload to the ExecuteScript Method, which now takes an OnSqlFileFailed Delegate to handle exceptions thrown when executing the sql file.

Hope you enjoy the new version.
Cheers

– Gerhard

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Posted in Releases | No Comments »

Exception: NoPrimaryKeyFoundException

Posted by Gerhard Stephan on 28th January 2008

The NoPrimaryKeyFoundException will be thrown if the user tries to query an entity type which has no valid primary key defined by the PrimaryKey attribute. In case that you use a pre-defined base object like "AutoIncValueObject" or "ValueObject" this exception will never occure.

To solve this exception, include a property to your entity type which is tagged with the PrimaryKey attribute or use a pre-defined base class.

    /// <summary>

    /// Interface that describes a person

    /// </summary>

    public interface IPerson : IValueObject

    {

        /// <summary>

        /// Gets or sets the unique value object id.

        /// </summary>

        /// <value>The unique value object id.</value>

        [PrimaryKey]

        new int? Id

        {

            get;

            set;

        }

 

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Posted in Exceptions | No Comments »

Attribute: [View]

Posted by Gerhard Stephan on 18th January 2008

This attribute can be used to define that a class is mapped to a database view.

      [View („VW_CONTACTS“)]

      public class Contact : ValueObject

 

The attribute is important for the Persisters, because some selects will fired in a different way, if you query a database view. If you want to map a database table, you can use the attribute called "Table".

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Posted in Attributes | No Comments »

New Release – AdFactum ObjectMapper .NET 2.2.2418.0

Posted by Gerhard Stephan on 18th January 2008

Four days after the last release I have to publish a small bug fix for all oracle users.

The last change, adding the ROWID to all pageselects, did not work, when querying a database view. And that’s correct, because a database view does not offer a ROWID. So what did I change? It’s now possible to define, that a .NET class is mapped to a database view. This can be done by using the new attribute called "View", instead of using the attribute "Table".

As a second bugfix I changed WithClause. Using the WithClause in prior versions could force a cartesian product, because all tables of the With-Clause have been exposed to the Parent SQL, which is an unwanted behaviour.

Hoping that this will be the last hotfix for this month I wish you a great weekend.

Cheers
– Gerhard

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Posted in Releases | No Comments »

New Release – AdFactum ObjectMapper .NET 2.1.2414.0

Posted by Gerhard Stephan on 14th January 2008

Today I present the first release of the AdFactum ObjectMapper .NET within the new year. So what does it cover? This release is one of the big one and covers a lot of minor changes and one or two bigger issues.

First of all I added a new persister especially for the old Sql Server 2000 version, which does not support the analysis functions used by the paging algorithm. As another big new feature, I added a "DeleteRecursive" method which allows to delete object trees by using a given hierarchy level.

The minor features are less impressive, but important to know:  Many method signatures have changed from using the old collections to the new generic collections. That makes it more easy to use this methods. Furthermore I changed a lot of code fragments so that they are FxCop conform and I reduced duplicated code fragments.

Following bugs have been fixed:

When using the Oracle Paging algorithm there has been a bug when paging a sorted list with identical sort values. Oracle retrieved differend row data. To solve this issue the ROWID has now been added as an additional sorting column.

The SQL Persister for Windows CE is now able to using SelectDistinct (which causes an error in earlier versions). Virtual Links are now correctly quoted, so that reserved words can  be used for it and SelectIds on XmlPersister will now work even if the target object is not defined within the XML file.

So that’s a lot stuff. Hope that everything works for your suffiency. If not, don’t hesitate to write within the forum or answer to this blog entry.

Wish you a great new year.
Cheers

– Gerhard

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...

Posted in Releases | No Comments »