|
Once a query is built and its raw results are returned, they need to be converted into entities, entity graphs or projection.
In Hibernate ORM, this is the role of QueryLoader or CustomLoader. These share most of their "loading" code from the AbstractLoader class (esp wrt loading the right graph).
Since OgmLoader is essentially a ripoff the ORM's Loader hierarchy, we could do the same and have an OgmQueryLoader / OgmCustomLoader. The key would be to wrap the data loader by the dialect when executing the native query into a ResultSet. The existing OgmLoader / Ogm*Persister code uses such technique via TupleAsMapResultSet. This could be of inspiration.
|