hibernate - adding a or condition with criteria -


i want add or condition

ecmodifiedcompany.addeq("modifiedcompanyname", instance.getmodifiedcompanyname()) 

is there way this?

entitysearchcriteria ecmodifiedcompany= new entitysearchcriteria(); ecmodifiedcompany.addeq("modifiedcompanyname", instance.getmodifiedcompanyname()); ecmodifiedcompany.addeq("technology",instance.gettechnology()); ecmodifiedcompany.addne("id", instance.getid()); 

yes, criteria has disjunction, can use this,

criteria.add(restrictions.disjunction()     .add(restrictions.eq("field", value))     .add(restrictions.eq("field",value))); 

Comments