Rafael Roque Rafael Roque - 11 months ago 29
Java Question

Mapping Java boolean to Oracle number

I have a property created like this in my model:

public class Client {
private Boolean active;


My RDBMS is Oracle,and the column is a number(1,0)

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



Hibernate does the Boolean to Oracle NUMBER(1,0) automatically, so you can use a Boolean value in your Criteria queries and the generated SQL will use the database boolean format instead.