Ayende @ Rahien

It's a girl

NHibernate 2.0 Beta 1 Released

image

NHibernate 2.0.0.Beta1 is released today. It is comparable to Hibernate 3.2 in terms of features.  Get the bits while they are hot.

Comments

Fabio Maulo
06/29/2008 10:30 PM by
Fabio Maulo

wwwonderful logo !!!!

Casey
06/30/2008 06:51 AM by
Casey

Oren, thanks for the update, and thanks to all those who have worked hard on this.

Ohad Aston
06/30/2008 04:32 PM by
Ohad Aston

wwwonderful framework!!!!

Billy Stack
07/01/2008 07:37 AM by
Billy Stack

I notice that there is no LINQ with NHibernate 2.0 beta, although they do say that NHibernate with LINQ is a subproject that is ongoing.

When do you see LINQ being released in an NHibernate future version?

Carsten Hess
07/01/2008 11:40 AM by
Carsten Hess

Super work! ;-)

I have an issue with the "ProxyTypeValidator" which hasn't changed from 1.2 to 2.0:

The problem is that the validator does not catch all failing conditions for a class to be subclassed by a proxy:

For some reason (error ?) .NET returns true for "IsVirtual" on a method if the method is defined in an interface which the class extends. But at the same time the method will be marked as Final.

So when you check for a method being virtual you will erroneously accept a method which is not virtual but is an implementation of an interfacemethod!

I'm using the following method to do extra check:

private static bool IsNotVirtual(MethodInfo method)

{

return (!method.IsVirtual || method.IsFinal);

}

Would be nice to know why Microsoft decided to do this - theres no reasons in doc.

At the same time its also necessary to check that the virtual methods are public! - otherwise the proxy's methods are not called...

Hope you can use the input and incorporate changes.

Kind regards

Carsten

Ayende Rahien
07/01/2008 01:40 PM by
Ayende Rahien

When it is stable enough to cover all core scenarios.

Currently it is being field tested on several projects, and you can get the source and compile your own version.

No commitment for release date for that, but any help is welcome

Ayende Rahien
07/01/2008 02:03 PM by
Ayende Rahien

Carsten,

It has to do with how you deal with dispatching a method call at runtime.

This is a fairly standard way of doing that.

Please create a JIRA issue for that

Bogdan Pietroiu
07/03/2008 01:07 PM by
Bogdan Pietroiu

Ayende, I know that you are involved in nhibernate dev. Do you know where can I report an issue related to mapping problems?

I tested today some inheritance scenarious using nh2 (from svn) along with the latest bits from ActiveRecord (from svn ) and I could not

load a simple joined base class hierarchy

here is the xml generated by Active Record

<?xml version="1.0" encoding="utf-16"?>

<hibernate-mapping auto-import="true" default-lazy="false" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:nhibernate-mapping-2.2">

<id name="EntityId" access="property" column="EntityId" type="Int32" unsaved-value="0">

  <generator class="identity">

  </generator>

</id>

<join table="BaseEntity_Ext">

  <key column="EntityId" />

</join>

<joined-subclass name="AR1.Model.PersonEntity, AR1" table="PersonEntity">

  <key column="EntityId" />

  <join table="PersonEntity_Ext">

    <key column="EntityId" />

  </join>

</joined-subclass>

</hibernate-mapping>

here are the classes used to generate that mapping

[ActiveRecord, JoinedBase, JoinedTable("BaseEntity_Ext")]

public class BaseEntity : ActiveRecordBase<BaseEntity>

{

    private int entityId;


    [PrimaryKey(Generator = PrimaryKeyType.Identity)]

    public virtual int EntityId

    {

        get { return entityId; }

        set { entityId = value; }

    }

}


[ActiveRecord, JoinedTable("PersonEntity_Ext", Column = "EntityId")]

public class PersonEntity : BaseEntity

{


    [JoinedKey]

    public override int EntityId

    {

        get { return base.EntityId; }

        set { base.EntityId = value; }

    }

}

when I load this mapping I get this error:

(string)(11,6): XML validation error: The element 'class' in namespace 'urn:nhibernate-mapping-2.2' has invalid child element 'joined-subclass' in namespace 'urn:nhibernate-mapping-2.2'. List of possible elements expected: 'join, subclass, loader, sql-insert, sql-update, sql-delete, filter' in namespace 'urn:nhibernate-mapping-2.2'.

Bogdan Pietroiu
07/03/2008 01:19 PM by
Bogdan Pietroiu

I found out the source of the problem: JoinedTable is not accepted on any class from a JoinedBase hierarchy. I wonder if this is by design ...

Ayende Rahien
07/03/2008 03:23 PM by
Ayende Rahien

The mailing list is a good place, as is our JIRA

Cary McAnally
07/25/2008 06:43 PM by
Cary McAnally

I am currently evaluating 1.2 nhibernate to use in in project we just started to rewrite a very large VB6 app in .net. I have built an example\demo application but I am quickly finding that I need functionality in nhibernate 2.0. I can not put Beta code into production. I need an estimate when 2.0 will be GA to determine if I am going to continue with nhibernate or choose another tool.

Ayende Rahien
07/25/2008 07:45 PM by
Ayende Rahien

Cary,

We do not promise ship dates.

That said, it is soon.

You can start develop using the beta and switch to the RTM version when it is done.

If you are interest in helping make NH 2.0 happen faster, there are several ways to make this happen, ranging from paying for time spent on it to contributing

Comments have been closed on this topic.