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:
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();
}
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.
Wow, have been waiting for this for a long time...
ReplyDeleteGreat news, i will start by updating all my test tear downs!
ReplyDeleteman, thats wonderfull !!!!
ReplyDeleteWohoo! This is what NH really needed!
ReplyDeleteGreat Improvement! Thanks Fabio one more time!
ReplyDelete