Skip to content

How It Works

gert-wijns edited this page Sep 13, 2014 · 1 revision

The query builder works by making extensive use of proxies.

The entities and result dtos are proxies which capture the method invocations. If you are familiar with EasyMock, then think of the query builder as EasyMock mocks for entities and dtos with predefined expectLastCall handling. The main difference with EasyMock would be that no statics are used, so it is possible to create more than one query simultaneously.

The captured method invocations of entity proxies are used together with the information available in hibernate (through the session factory), this enables some validation and allows to make some decisions without extra configuration.

The query builder uses a specialized ResultTransformer to allow making use of a wide range of selection options.

Clone this wiki locally