I'm trying to implement a Grid data source optimized for database
retrievals (with paging support). Basically it's derived from
HibernateGridDataSource from Tapestry distribution, and provides support
for complex Criteria queries:
https://gist.github.com/xfyre/ecb36a9173aed6a37f14

However, there is a problem with sorting.

Provided BeanModel implementation doesn't support nested properties; that
is, I cannot use properties of child Hibernate entities: <t:grid
include="property1, child1.property1, child2.property2" .../> results in
error. Initially I had a workaround of having helper getter methods in
parent entity class, so it looked like  <t:grid include="property1,
child1Property1, child2Property2" .../>. It worked, but when I'm trying to
use database-backed Grid data source, there's an error with sorting
(because sorting is performed on database level and obviously root entity
of the query doesn't contain database properties specified in Grid.

Is there any reasonable solution for that, besides manually providing all
required mappings between Grid property names and database property names?

-- 
Ilya Obshadko

Reply via email to