gert-wijns / TypeSafeQueryBuilder

Compile time assistence while creating queries, making them more type safe and easier to refactor
6 stars 8 forks source link

Add 'cast' or 'as' feature to support left joined subtypes #12

Closed gert-wijns closed 10 years ago

gert-wijns commented 10 years ago

When an object has a link to a super type of some specific types, it is possible in hibernate to left join the super type and use the property paths of the specific types to narrow the result. This can be done by using a 'cast' or 'as' feature which would return the proxy as one of the subtypes.

gert-wijns commented 10 years ago

Another remark: when not 'left joining' you can just use an extra from and bind the enitites in the where clause. This issue needs to be implemented for the case when you require a left join.

gert-wijns commented 10 years ago

Implemented in v1.8.0.

Use query.getAsSubtype(proxy, subtypeclass), see javadoc.