NHibernate Forge
The official new home for the NHibernate for .NET community

NH2.1: Executable HQL

[from my blog]

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.


Posted may 05 2009, 10:54 a.m. by Fabio Maulo

Comments

Fred Morrison wrote re: NH2.1: Executable HQL
on 05-06-2009 15:55

A welcome addition.  Good job.  Have a favorite adult beverage and relax for a few hours.

bunceg wrote re: NH2.1: Executable HQL
on 05-07-2009 5:37

Good that 2.1 GA was postponed for this, but any news on how it is coming along? Is there an expected date?

Fabio Maulo wrote re: NH2.1: Executable HQL
on 05-07-2009 9:46

not only for this...."one of the reasons" mean that there are some other but it is a matter of the main team.

NHibernate blog wrote New Kid on the Block. And some info on Linq to NHibernate
on 05-07-2009 16:17

This is my first post on this site as an NH committer, and I'm very pleased to be part of the team

Powered by Community Server (Commercial Edition), by Telligent Systems