[hibernate-dev] Feature Proposal for Hibernate Search

Hardy Ferentschik hardy at hibernate.org
Tue Feb 4 05:39:14 EST 2014


On 3 Jan 2014, at 22:22, Emmanuel Bernard <emmanuel at hibernate.org> wrote:

>>> - I don't think annotations are the best way to express queries but you probably 
>>> have your reasons, so let's discuss them :)
>> Why? I think it's not hard to read an you have the query right with your ParameterWrapper-class which holds your data.
> 
> Indeed I like that both the query and the parameter values are hosted on the same class.

That’s the part I kind of like here as well

> And I would have the programmatic query expressed on that class.

That’s an interesting thought.

> But annotations in my opinion don't scale very well for tree structures.

I share Emmanuel’s concern on this one. I think you would get some quite nasty constructs, once you want to provide the full query capabilities. 
Whether or not annotations defined queries would then be easier to read than DSL queries becomes then a matter of taste. 
I for example am still holding on to good old native Lucene queries.

For a pure dev point, supporting all these different query capabilities is of course a pain, since the work you have to do for each new feature keep growing.

—Hardy


More information about the hibernate-dev mailing list