Skip to main content
Nope, SessionFactory is NOT the JPA API. It is Hibernate. This is Hibernate-Criteria
Link
formatting
Source Link
Jibran Khan
  • 3.3k
  • 4
  • 40
  • 52

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

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

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()); 
added 18 characters in body; edited title
Source Link
Vlad Mihalcea
  • 155.9k
  • 85
  • 599
  • 984

Mapping Java boolean to Oracle numberNumber 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 and the active column is a number(1,0)of type NUMBER(1,0).

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

criteria.add(Restrictions.eq("active"),object.isActive()); 

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?

criteria.add(Restrictions.eq("active"),object.isActive()); 

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()); 
edited tags
Link
Vlad Mihalcea
  • 155.9k
  • 85
  • 599
  • 984
Loading
edited tags
Link
Vlad Mihalcea
  • 155.9k
  • 85
  • 599
  • 984
Loading
Restrictions is NOT the JPA API. Hibernate specific
Link
Neil Stockton
  • 11.6k
  • 3
  • 36
  • 29
Loading
edited tags
Link
Vlad Mihalcea
  • 155.9k
  • 85
  • 599
  • 984
Loading
Source Link
Rafael Roque
  • 377
  • 2
  • 5
  • 14
Loading