[hibernate-issues] [Hibernate-JIRA] Commented: (HSEARCH-951) excludeLimit() has no effect on QueryBuilder.range().above() queries

Sanne Grinovero (JIRA) noreply at atlassian.com
Sat Dec 31 07:10:19 EST 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44802#comment-44802 ] 

Sanne Grinovero commented on HSEARCH-951:
-----------------------------------------

Backporting (as requested) to 3.4.2 as HSEARCH-1023

> excludeLimit() has no effect on QueryBuilder.range().above() queries
> --------------------------------------------------------------------
>
>                 Key: HSEARCH-951
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-951
>             Project: Hibernate Search
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 3.4.1.Final, 4.0.0.CR1
>            Reporter: Marko Lukša
>            Assignee: Hardy Ferentschik
>            Priority: Trivial
>             Fix For: 4.0.0.CR2
>
>
> When executing the following code, the {{excludeLimit()}} call has no effect.
> {code}
> Query query = queryBuilder
>       .range()
>          .onField("letter")
>             .ignoreFieldBridge()
>             .ignoreAnalyzer()
>          .above("b").excludeLimit()
>       .createQuery();
> {code}
> It's caused by a minor bug in {{ConnectedMultiFieldsRangeQueryBuilder.excludeLimit()}}:
> {code}
> public RangeTerminationExcludable excludeLimit() {
>     if ( rangeContext.getFrom() != null && rangeContext.getTo() != null ) {
>         rangeContext.setExcludeTo( true );
>     }
>     else if ( rangeContext.getFrom() != null ) {
>         rangeContext.setExcludeTo( true );            <----  should be From, not To
>     }
>     else if ( rangeContext.getTo() != null ) {
>         rangeContext.setExcludeTo( true );
>     }
>     else {
>         throw new AssertionFailure( "Both from and to clause of a range query are null" );
>     }
>     return this;
> }
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       



More information about the hibernate-issues mailing list