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,589
|
Comments: 51,218
Privacy Policy · Terms
filter by tags archive
time to read 1 min | 157 words

Here is an interesting question, I got several reqeusts to add an EntityList<T> to NHibernate Generics. One of the more interesting attributes on NHibernate Generics is that I can execute an action when an item is added or removed to the set. The problem that I've now is adapting it to the indexer of IList<T>, how I should behave with regard to it? There are three possibilities:

  • Override a value with the same value - do nothing
  • Override a value with a new value - call remove on the old value and add on the new value
  • Override a value with a ne value already on the list - what do I do here?

Any suggestions?

time to read 2 min | 366 words

Okay, it's about time that I update this thing. Now it's properly versions in the NQA repository, and you can reach it via: svn://svn.berlios.de/nqa/NHibernate.Generics/ or via: http://svn.berlios.de/wsvn/nqa/NHibernate.Generics/.

There are some new stuff there as well:

  • Tests for ManyToMany, which a lot of people requested.
    • Pay attention to many-to-many, lazy loading, and the edge case I talk about here.
    • I added an overload for this, and you must use this overload when you are creating the collection that will be the authoritative source (inverse=false, in the mapping). Check the User class in the tests for the detials.
  • Proper handling of Clear() on EntitySet
  • Introducing the AllowModification, and this one require some explenation. I found myself needing to modify the EntitySet<T> from within the action for adding and removing items. This caused problems, because ordinarily this would mean that I would get an infinite loop, but no worries, you can see how I solved it below (which is why I need the DisposableAction for). There is a similar property for the EntityRef<T>.
   1:  //Require a class member variable, can't use a local
   2:  //variable, because of delegates rules.
   3:  _posts = new EntitySet<Post>(
   4:  delegate(Post p)
   5:  {
   6:      using (_posts.AllowModifications)
   7:      {
   8:          _posts.Add(new Post("Duplicate"));
   9:      }
  10:  }, null);
  11:  _posts.Add(new Post("Original"));
  12:  Assert.AreEqual(2, _posts.Count);

That is all for now, I think. I changed the download to be just the compiled dll (you can get the source from the repository above). Most important of them all, I updated the documentation with the new stuff.

One interesting tidbit, so far I had over 950 dowloads of NHibernate Generics!

time to read 1 min | 146 words

The reason that I created NQA is that I wanted to understand how NHibernate did its magic. I was rathered surprised when people started using it to work with NHibernate on a regular basis. I added some schema editing features that people asked for them.

I then turned to greener pastures, ActiveRecord, namely. I recently got into situations where it can't go. (Really weird schemas, etc). After I stopped feeling betrayed (What do you mean, you only read 99% of my mind?) I sat down to code it. That was where NQA was really helpful. I know hbm (the mapping syntax for NHibernate), but it's not a trivial syntax, with many hidden gotchas for the unwary.

I was able to point & click and get the desired schema very quickly. I'm very proud of it. :-)

time to read 1 min | 140 words

I just spent several hours investigate possible ways to get NQA to play nicely with Nullables. I can't do it. The issue is explained here, but the gist of it is that the framework doesn't work as advertise, and I don't have a place to put code that would fix the problem.

I'm loading an assembly using Assemly.LoadFile() and I need to get a type from this assembly when NHibernate calls Type.GetType(). The TypeResolve event does not fire, so I'm out left to dry.

I'm sorry for any user of NQA that uses Nullables, and I'm frustrated that I can't get it to work, but I'm not going to sink any more of my time into it.

That is all. Oh, and a happy new year :-)

time to read 1 min | 89 words

This is embarrassing, I just realized that I'd a spelling mistake in NHibernate Query Analyzer on my site for at least four months.

I fixed it, but this also means fixing the URL :-(

I updated most of the links on my sites, but be sure to fix any links to it if you have any.

The links are:

http://www.ayende.com/projects/nhibernate-query-analyzer.aspx - Project page.

http://www.ayende.com/projects/nhibernate-query-analyzer/flash-demo.aspx - The demo.

http://www.ayende.com/projects/nhibernate-query-analyzer/downloads.aspx - Download page
time to read 1 min | 141 words

I just closed a very old bug in NQA, old is three months and it was a very annoying but minor bug regarding focus in the object graph window, thanks to the netorn project that got me on the right track again!

In addition, I also fixed the choppy drawing when you use the mouse wheel to scroll the control, now it's simply perfect :-) It's amazing how very little can sometimes cause you to "see the light".

As usual, get the latest drops at the download page. If we are talking about downloads, NHiberante Query Analyzer 0.9 was downloaded 1234 times, which it a pretty number, in my humble opinion.

I got a lot of mail and fix a lot of bugs since releasing it again which makes it far more interesting to work on it.

FUTURE POSTS

  1. RavenDB 7.1: The Gen AI release - 13 hours from now
  2. RavenDB and Gen AI Security - 4 days from now
  3. RavenDB & Distributed Debugging - 7 days from now
  4. RavenDB & Ansible - 12 days from now

There are posts all the way to Jul 22, 2025

RECENT SERIES

  1. RavenDB 7.1 (7):
    18 Mar 2025 - One IO Ring to rule them all
  2. Production postmorterm (2):
    11 Jun 2025 - The rookie server's untimely promotion
  3. Webinar (7):
    05 Jun 2025 - Think inside the database
  4. Recording (16):
    29 May 2025 - RavenDB's Upcoming Optimizations Deep Dive
  5. RavenDB News (2):
    02 May 2025 - May 2025
View all series

Syndication

Main feed ... ...
Comments feed   ... ...
}