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 -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -