- /s filter to remove invalid data
  
 
 - /* DETACHEDCRITERIA.ADD (
  
 
 - Restrictions.or (
  
 
 - Restrictions.like ("Chanpin", "refrigerator", matchmode.anywhere),
  
 
 - Restrictions.or (
  
 
 - Restrictions.like ("Chanpin", "Washing Machine", matchmode.anywhere),
  
 
 - Restrictions.or (
  
 
 - Restrictions.like ("Chanpin", "water heater", matchmode.anywhere),
  
 
 - Restrictions.like ("Chanpin", "air conditioner", Matchmode.anywhere))))
  
 
 - );
  
 
 - */
  
 
 - Disjunction dis=restrictions.disjunction ();
  
 
 - Dis.add (Restrictions.like ("Chanpin", "refrigerator", matchmode.anywhere)); 
  
 
 - Dis.add (Restrictions.like ("Chanpin", "washing machine", matchmode.anywhere)); 
  
 
 - Dis.add (Restrictions.like ("Chanpin", "water heater", matchmode.anywhere)); 
  
 
 - Dis.add (Restrictions.like ("Chanpin", "air conditioning", matchmode.anywhere)); 
  
 
 - Detachedcriteria.add (DIS);
  
 
 - //e filtering to remove invalid data
  
Method used to combine a set  of logical OR "or" conditions
Java code 
 
  
  - Restrictions.disjunction ();
  
 
 
A method used to combine a set of logical and "and" conditions
Java code 
 
  
  - Restrictions.conjunction ();
  
 
 
Comment out part of the code, the query results and the following code, if you write multiple logic or conditions for a field, the following way is better. Select the appropriate method according to the specific situation.
Usage of OR and and in hibernate criteria