Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Don't Never excludeNone with Hibernate Example

 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
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.


excludeNone()
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