Open
Description
query by example is an efficient way to implement a multicriteria search, it has limitations (between, or), but not all use cases hit these limitations and it is much easier to use than LINQ when all criteria are optional.
Unfortunately associations are ignored. For instance,SQL generated from this example
var example = new Book() {
Title = "...",
Author = new Author() {Lastname = "..."},
Category = new Category(){Id = 1}
};
will not include restriction on author lastname and category id.
In Java world, spring-data-jpa project's implementation of query by example includes several associations (not sure for 1-n and n-n). It would be nice to have this feature in NHibernate.