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

java - Callback from new thread to class from which thread was initiated -

Receive udp packets in android gstreamer -

php - Extract Text from HTTP referer -