[hibernate-issues] [Hibernate-JIRA] Created: (HSEARCH-744) NullPointerException when using a range query on a numeric field and searching for values below a given boundary

Nikita D (JIRA) noreply at atlassian.com
Mon May 9 15:07:59 EDT 2011


NullPointerException when using a range query on a numeric field and searching for values below a given boundary 
-----------------------------------------------------------------------------------------------------------------

                 Key: HSEARCH-744
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-744
             Project: Hibernate Search
          Issue Type: Bug
          Components: query
    Affects Versions: 3.4.0.Final
         Environment: Hibernate Core 3.6.3, MySQL 5.1.55
            Reporter: Nikita D


When using the query API to search for values below a boundary, a NullPointerException is thrown if the field is a numeric field (annotated with @NumericField). Example query:

{code}
Query luceneQuery = qb
    .range()
    .onField("myNumericField")
    .below(myMaxValue)
    .createQuery();
{code}

The problem is in NumericFieldUtils.createNumericRangeQuery(), which always uses the "from" value to determine the class. For a "below" query, the "from" value is null.

Stacktrace:
{code}
java.lang.NullPointerException
	at org.hibernate.search.bridge.util.NumericFieldUtils.createNumericRangeQuery(NumericFieldUtils.java:17)
	at org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsRangeQueryBuilder.createQuery(ConnectedMultiFieldsRangeQueryBuilder.java:104)
	at org.hibernate.search.query.dsl.impl.ConnectedMultiFieldsRangeQueryBuilder.createQuery(ConnectedMultiFieldsRangeQueryBuilder.java:79)
{code}


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list