Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Extend query by example to associations #2281

Copy link
Copy link
Open
@ah1508

Description

@ah1508
Issue body actions

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.