I have a client application that connects to a server. The server uses sleep mode for saving and requests, therefore it has a set of annotated sleep mode objects for saving.
The client sends HQL queries to the server and returns responses. The client has an automatically generated set of objects that correspond to the server's sleep mode objects for query results and basic persistence.
I would like to support the use of Linq for query, as well as for Hql, as it makes query types safer and faster (there are no more typos in HQL string queries). I looked at the following, but I can’t figure out how to make them fit what I have.
- NHibernate Linq Provider - Requires NHibernate ISession and ISessionFactory, which I do not have
- LinqExtender - requires a lot of annotations on objects and an extension of the base type, too invasive
What I really want is what will generate gives me a nice, easy-to-handle structure for creating HQL queries. I read most of the 15-page article written by one of the C # developers on how to create custom providers, and this is quite fraught, mainly due to the complexity of the expression tree.
Can someone suggest an approach for implementing the Linq → HQL translation? Perhaps a library that clears the expression tree in something else SQL / HQLish.
I would like to support select / from / where / group by / order by / join. Not too worried about subqueries.