c# - sql hibernate and or restrictions -


my sql should this:

select cell1 table cell2 = 1 , (cell3 = '' or cell3 null) 

but how "and ( x or y )" restricion hibernate?

what logicalexpression

try and condition:

criteria cr = session.createcriteria(table.class);  // records matching , condistions logicalexpression andexp = restrictions.and(cell2, cell3); cr.add( andexp ); 

for or condition use this

 // records matching or condistions   logicalexpression orexp = restrictions.or(cell2, cell3);   cr.add( orexp );   list results = cr.list(); 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

javascript - Get parameter of GET request -

javascript - Twitter Bootstrap - how to add some more margin between tooltip popup and element -