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

Marko Lukša (JIRA) noreply at atlassian.com
Sun Oct 16 10:49:23 EDT 2011


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: 4.0.0.CR1, 3.4.1.Final
            Reporter: Marko Lukša
            Priority: Trivial


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