<span class="postbody">Hi,<br><br>Some time ago I submitted a minor bug having to
do with named sql query mapping/binding
(<a href="http://opensource.atlassian.com/projects/hibernate/browse/HHH-3108">http://opensource.atlassian.com/projects/hibernate/browse/HHH-3108</a>)
and subsequently fixed it. Hibernate page mentions that contributions
should be submitted in patch format, but doesn't say to what version / svn tag -
I presume last stable one, that is <a href="http://3.2.6.ga">3.2.6.ga</a>?
<br>
<br>As I already spent some time debugging and got a basic
understanding of the code, I thought I might add some functionality I
heavily miss. The question is, is it possible for such a user
contribution to make it to be incorporated into the code? If so, what
would be the procedure and requirements? <br>
<br>My issues with hibernate I'd like to improve concern efficiency and
control of fetching whole graphs of objects with many associations:
<br>
<br>1. First of all, a possibility of specifying a custom collection
loader for fetch='subselect' on a per-query basis. The root query would
be able to define a subselect query used to fetch collections owned by
returned entities (ideally also nested associations). If original query
is complicated (involves joins or subselects), current solution is
highly ineffective and I found I could often write optimized queries
returning the same data. This is especially pronounced when a large
percentage of total data in the table is returned by associated
queries.
<br>
<br>2. Do some automatic optimization for fetch="subselect". Most
notable example is fetching collections defined in subclasses of an
entity returned by a polymorphic query. When using
table-per-concrete-subclass approach, first query results in an SQL
with a couple of joins, and is then used literally as a subselect in
the query for associated objects. In most cases it would be sufficient
to do the subselect only against the base class table.
<br>
<br>3. Allow to use HQL queries as collection loaders, not only SQL
queries. I don't know, maybe you're currently working on it - it seems
so natural and I've seen a feature request in JIRA.
<br>
<br>If you'd be interested in such improvements and find them compatible with the project's roadmap, please let me know. I am very enthusiastic about seeing them in hibernate - the lack of 1) pushed us to drop hibernate for
a more flexible, low-level solution in some projects having a complicated object model (arguably exactly those which would really benefit
from a model-driven persistance approach). Unfortunately, there's no
way my company would allow usage of an in-house patched version of
hibernate,
so my work on such a patch would be mostly a waste of time if it didn't make it to a release one day.</span><br clear="all"><br>Best regards,<br><br>-- <br>c):-i Marcin MoĊcicki<br>---------------------------------------------------------------------------------------------------<br>
It is, as far as he knows, the only way of coming downstairs,<br> but sometimes he feels that there really is another way,<br> if only he could stop bumping for a moment and think of it.<br> And then he feels that perhaps there isn't.<br>