[hibernate-dev] HSEARCH-615 Support time-constrained queries returning the first available results

Sanne Grinovero sanne.grinovero at gmail.com
Sat Nov 6 07:31:17 EDT 2010


Hello,
about naming I have no better ideas:
.limitFetchTime() //slightly different, not very happy about it either

about API, does it really make sense to have hasPartialResults() as a
method of the Query?
It should be a List property I think - I have no strong opinions about
this as I don't like having to extend the List implementation.

But really Query is something I might want to reuse - unlikely but I'd
expect that to work fine.
So what about:

SomeNewList results = query.list(500, TimeUnit.MILLISECONDS)
or a batter named method.

So:

if ( results.hasPartialResults() ) {
    displayWarningToUser();
}

This is one of those cases in which I miss the option of having a
couple of values from a function.

Sanne

2010/11/5 Emmanuel Bernard <emmanuel at hibernate.org>:
> If you can find better name for the API, please advise. I am not happy with the current version
>
> Query luceneQuery = ...;
> FullTextQuery query = fullTextSession.createFullTextQuery(luceneQuery, User.class);
>
> //define the timeout in seconds
> query.limitFetchingTime(500, TimeUnit.MILLISECONDS);
> List results = query.list();
>
> if ( query.hasPartialResults() ) {
>    displayWarningToUser();
> }
>
> Emmanuel
> _______________________________________________
> hibernate-dev mailing list
> hibernate-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-dev
>




More information about the hibernate-dev mailing list