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
Post a Comment