I am sorting with the following code:
undoneCategories = session.createCriteria(Category.class);
undoneCategories.add(Restrictions.eq("Done", false));
undoneCategories.addOrder(Order.asc("UpwardGenerator"));
undoneCategories.setMaxResults(1);
where UpwardGenerator
is boolean
.
How will it be sorted? With false
first, or with true
first? What about null
/nil
/undefined values?
It will sort false
first, since in the database true
and false
are represented as 1
and 0
, respectively.