• Post Reply Bookmark Topic Watch Topic
  • New Topic

Don't Never excludeNone with Hibernate Example  RSS feed

Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just found this a little confusing.

When creating a query using the Example object and the Hibernate Criteria API, you can create a query that excludes null values, which is the default, and you can also exclude zero values by calling the excludeZeroes() method. However, I wanted to exclude blank, non-null String objects, so I supposed excludeNone() would do the trick. Silly me.

The excludeNone() actually doesn't exclude null or zero-valued properties. Still, I found the 'double-negative' description of the method a little misleading.

Don't exclude null or zero-valued properties

Example excludeNone method from the Hibernate Criteria API JavaDoc

-Cameron McKenzie
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!