| Hi Sergey! I see that join support is requested for Ignite OGM. In our project (migration from Oracle to GridGain with use of JPA) we also need this hardly, as other features like support of associations in where/order by, jpql/sql functions (upper, lower etc) and more. Finally, I started to rework query rendering completely. With approach used now (rendering by OGM engine with use of IgniteQueryRendererDelegate + IgnitePredicateFactory) I found it very hard to implement such functionality due to restrictions. So I wrote own renderer which takes query tree generated by hql parser and recursively renders it into SQL query. Here is a first implementation: https://github.com/hibernate/hibernate-ogm-ignite/compare/master...Salauyou:query-rendering-rework?expand=1 Features implemented:
- support of querying by association properties of any level ( select h from Hypothesis h where h.author.address.city = :city or h.author = :author order by h.author.name )
- support of explicit joins of different types ( select a from Hypothesis h left join h.author a where h.date > :date )
- jpql functions `upper`, `lower`, `concat` ( from Address where concat(upper(city), ' ', upper(street)) = upper(:address) )
Bugs fixed:
- for queries with multiple parameters, actual parameter values are passed in random order ( from Hypothesis where position in (:positions) and author = :author and date > :date )
- exception if predicate doesn't follow "property-operation-value" pattern ( from Hypothesis h where :author = h.author )
I'd like to discuss. |