Oren Eini

CEO of RavenDB

a NoSQL Open Source Document Database

Get in touch with me:

oren@ravendb.net +972 52-548-6969

Posts: 7,525
|
Comments: 51,160
Privacy Policy · Terms
filter by tags archive
time to read 1 min | 89 words

One of the most common issues that people have run into with using NHQA is the DuplicateMappingException. The root problem is that you are adding both the DLL (which contained embedded resources mapping files) and the mapping files themselves.

Well, after getting tried of answering that question so often, I decided to fix the issue, and let NHQA knows about the issue, and try to resolve it. The fix is in the repository now, but I would like to have some more input before I would release it.

time to read 2 min | 273 words

In the repository (Exists / NotExists):

   1:  [Test]
   2:  public void CanQueryOverCollections()
   3:  {
   4:      User one = User.FindOne(Where.User.Blogs.Exists(
   5:                                  Where.Blog.Name == "Ayende @ Blog"
   6:                                  ));
   7:      Assert.IsNotNull(one);
   8:  }
 
Will result in:
 
   1:  SELECT this_.Id as Id4_0_, this_.Name as Name4_0_, this_.Email as Email4_0_ 
   2:  FROM Users this_ WHERE exists (SELECT this_0_.Id as y0_ FROM Blogs 
   3:  this_0_ WHERE this_0_.Name = @p0)

 

Fluent interfaces? Take that.

time to read 1 min | 112 words

I am a bit late with this one, but here is a new version for NHibernate 1.2 GA. This also supports Castle Active Record, hopefully in a version neutral way.

You can get it here, or admire the UI here:

image

As an aside, I am thinking about adding Criteria Query functionality, since this is something that I use a lot. I am not sure yet what form this would take, at any rate it would involve runtime code generation, so that is complex (and sort of fun/pain).

I am opened to ideas.

Have fun...

time to read 2 min | 366 words

If you have downloaded NQHG 1.7 and are trying to use it from Visual studio, you probably got the following error:

Cannot find custom tool 'NHibernateQueryGenerator' on this system. The issue is that I didn't update the setup script correctly, and the version that it registers as a COM addin is set to 1.6, while the assembly version is 1.7. This cause the COM load to fail.

This script will reset the NHQG version to the correct one, until I manages to find some time for fixing this properly.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\CLSID\{DE8A7135-96F6-47BA-9DC9-D7D837B4CDE3}]
@="NHibernate.Query.Generator.NHibernateQueryGenerator"

[HKEY_CLASSES_ROOT\CLSID\{DE8A7135-96F6-47BA-9DC9-D7D837B4CDE3}\Implemented Categories]

[HKEY_CLASSES_ROOT\CLSID\{DE8A7135-96F6-47BA-9DC9-D7D837B4CDE3}\Implemented Categories\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}]

[HKEY_CLASSES_ROOT\CLSID\{DE8A7135-96F6-47BA-9DC9-D7D837B4CDE3}\InprocServer32]
@="mscoree.dll"
"ThreadingModel"="Both"
"Class"="NHibernate.Query.Generator.NHibernateQueryGenerator"
"RuntimeVersion"="v2.0.50727"
"CodeBase"="C:\\Program Files\\Rhino\\NHibernate Query Generator\\NHQG.exe"
"Assembly"="NHQG, Version=1.7.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f"

[HKEY_CLASSES_ROOT\CLSID\{DE8A7135-96F6-47BA-9DC9-D7D837B4CDE3}\InprocServer32\1.7.0.0]
"Class"="NHibernate.Query.Generator.NHibernateQueryGenerator"
"CodeBase"="C:\\Program Files\\Rhino\\NHibernate Query Generator\\NHQG.exe"
"RuntimeVersion"="v2.0.50727"
"Assembly"="NHQG, Version=1.7.0.0, Culture=neutral, PublicKeyToken=0b3305902db7183f"

[HKEY_CLASSES_ROOT\CLSID\{DE8A7135-96F6-47BA-9DC9-D7D837B4CDE3}\ProgId]
@="NHibernate.Query.Generator.NHibernateQueryGenerator"

time to read 1 min | 124 words

There is a new build of NQA out, this time it works against (and only against, sorry) NHibernate 1.2 Beta 2.

This time I also added support for Active Record. All you need to do is add the Active Record assembly to your project, add the app.config, and you are set. The only requirement is that the Active Record configuration section will be named "activerecord".

Now you should be able to execute queries against your objects directly. This release is marked as beta, since I have not yet been able to give it the testing that it needs. Let me know how it goes.

You can get the bits here.

time to read 1 min | 102 words

I was asked to help an application that was suffering un-optimal performance with NHibernate today. The first thing that I did was upgrade the application to NHibernate 1.2 (which took some time, damn non-virtual methods).

After I was done, I run the application, and was basically done. Just by upgrading to 1.2, we saw a major performance improvement. Now, to be fair, this is not just because NHibernate 1.2 is so much better (although it is :-) ). It is that it has different defaults (specifically about lazy loading) that make a huge difference in performance.

FUTURE POSTS

  1. Fun with bugs: Advanced Dictionary API - 4 days from now

There are posts all the way to Nov 15, 2024

RECENT SERIES

  1. Challenge (75):
    01 Jul 2024 - Efficient snapshotable state
  2. Recording (14):
    19 Jun 2024 - Building a Database Engine in C# & .NET
  3. re (33):
    28 May 2024 - Secure Drop protocol
  4. Meta Blog (2):
    23 Jan 2024 - I'm a JS Developer now
  5. Production Postmortem (51):
    12 Dec 2023 - The Spawn of Denial of Service
View all series

Syndication

Main feed Feed Stats
Comments feed   Comments Feed Stats
}