The automatic creation of bean models can only do so much - I always find that the automatic model creation is great for getting started, but at some point it is always necessary to provide explicit bean models.
The pattern we end up with is something like this: model = beanModelSource.createDisplayModel model.include( <properties we want> ) model.add* (to get the properties that the introspector cannot find/properties that need extra arguments) ... the "include" part is important to avoid extra columns showing up when the data model is changed. So I guess that you do need to specify most of it manually - alternatively you could probably teach tapestry about the complex property types, but I prefer the manual way. -- Chris On Fri, Jan 2, 2015 at 9:45 AM, Ilya Obshadko <ilya.obsha...@gmail.com> wrote: > 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 >