Try fast search NHibernate

02 May 2009

NH2.1: Executable HQL

Mapping:

<class name="SimpleClass" table="TSIMPLE">
<
id type="int">
<
generator class="native" />
</
id>
<
property name="Description"/>
</
class>

Class:

public class SimpleClass
{
public virtual string Description { get; set; }
}

DB fill:

using (var s = OpenSession())
using (var tx = s.BeginTransaction())
{
s.Save(new SimpleClass {Description = "simple1"});
s.Save(new SimpleClass {Description = "simple2"});
tx.Commit();
}

So far doing this:

using (var s = OpenSession())
using (var tx = s.BeginTransaction())
{
s.Delete("from SimpleClass");
tx.Commit();
}

the log is:

OldDeleteLog

But from today (the day of worker), doing this:

using (var s = OpenSession())
using (var tx = s.BeginTransaction())
{
s.CreateQuery("delete from SimpleClass").ExecuteUpdate();
tx.Commit();
}

the log is :NewDeleteLog


what it mean is clear, no ?  ;)

Soon some news about bulk insert and update, in HQL.

Now you know one of the reasons because NH2.1.0 release, was postponed.


kick it on DotNetKicks.com

5 comments:

  1. Wow, have been waiting for this for a long time...

    ReplyDelete
  2. Great news, i will start by updating all my test tear downs!

    ReplyDelete
  3. Wohoo! This is what NH really needed!

    ReplyDelete
  4. Great Improvement! Thanks Fabio one more time!

    ReplyDelete