if what you mean by
Code:
//Criteria2:filter category in line form
criteria.CreateCriteria("LineList")
.CreateCriteria("Category")
.Add(Expression.Like("Code", categoryCode));
is
linelist.category.code like '%aCode%' Code:
c = criteria.CreateCriteria("LineList")
c.createAlias("category","categ")
c.Add(Expression.Like("categ.code", categoryCode));
would be more realistic
and you can use Disjunction for the OR
like in
Code:
List cats = sess.createCriteria(Cat.class)
.add( Restrictions.in( "name", new String[] { "Fritz", "Izi", "Pk" } ) )
.add( Restrictions.disjunction()
.add( Restrictions.isNull("age") )
.add( Restrictions.eq("age", new Integer(0) ) )
.add( Restrictions.eq("age", new Integer(1) ) )
.add( Restrictions.eq("age", new Integer(2) ) )
) )
.list();