2010/01/14

ActiveRecord 2.1 released

Yesterday was ActiveRecord 2.1 released. The binaries can be downloaded on SourceForge.

Most of the new functionalities in this release were contributed by Krzysztof Kozmic, a fellow castle committer, who was a great help to get this release out. More thanks go out to the HornGet team, whose efforts took a lot of work out of the release process. Finally, I want to thank all contributors for patches and spotting bugs.

So now what is new in that release?

Updated Dependencies

Castle.Core and Castle.DynamicProxy were updated to their newest releases (1.2 and 2.2 resp.).

NHibernate has been updated to the last stable version 2.1.4 and compiled against the new Castle libraries.

NHibernate.Linq and NHibernate.Search were compiled against NHibernate 2.1.4.

Default configuration feature

This new feature allows to skip all of the <add/>-tags from your configuration if you are only using the database’s default values. In this case your config will be reduced to:

<activerecord>
    <config db="MsSqlServer2005" csn="MyConnectionStringName"/>
</activerecord>

The default configurations are available for most databases.

Inferring PrimaryKeyType from property type

Inspired by FluentNH, ActiveRecord now infers the PrimaryKeyType from the key’s property type:

  • For Guid PrimaryKeyType.GuidComb is used
  • For string PrimaryKeyType.Assigned is used
  • All others default to PrimaryKeyType.Native as before.

Support for backfield and readonly properties

These property accessors are now available in ActiveRecord. Especially readonly is interesting, it allows to store values computed by the entities in the database and is therefore the complement to a computed table column.

6 comments:

mahara said...

I think you referred to NHibernate version 2.1.2.4000 instead of 2.1.4, right?

Anonymous said...

Yeah, exactly - what is NH 2.1.4?

Really looks like 2.1.2, but the binary is different than the official one - why is that?

Markus Zywitza said...

You're both right. That should read 2.1.2.4000 instead of 2.1.4.

The binaries are different as I used HornGet to get an assembly freshly build against current versions of Castle.Core and Castle.DynamicProxy.

Anonymous said...

I guess you should then keep the original NHibernate.dll and only include in AR the rebuilt NHibernate.ByteCode.Castle.dll, after all this is what actually depends on DynamicProxy

Markus Zywitza said...

I'll address that issue in a bugfix release coming soon.

Mauro said...

Hi, I have a question. The method UpdateSchema works when I add a property in a my class. But if I change attribute of property (for example column from 10 to 20), it doesn't work. Is it alright? How can I do that? (sorry fo rmy english)