Skip to main content
8 of 8
Nope, SessionFactory is NOT the JPA API. It is Hibernate. This is Hibernate-Criteria

Mapping Java boolean to Oracle Number column with JPA and Hibernate

I have a property created like this in my model:

 public class Client { private Boolean active; } 

My RDBMS is Oracle and the active column is of type NUMBER(1,0).

How can I use the Restrictions API to achieve the following functionality?

criteria.add(Restrictions.eq("active"),object.isActive()); 
Rafael Roque
  • 377
  • 2
  • 5
  • 14