Query extends Criteria { public static Query from( Schema schema ) { return new Query( schema ); } private  Query( Schema schema ); private  Query( Schema schema, Junction.Type rootJunctionType ); static Query from( Schema schema ); static Query from( Schema schema, Junction.Type rootJunction ); static Query from( Query query ); Schema getSchema(); boolean isEmpty(); List<Order> getOrders(); boolean ordersPersisted(); void clearOrders(); User getUser(); Query setUser( User user ); String getLocale(); boolean hasLocale(); void setLocale( String locale ); boolean isSkipPaging(); Query setSkipPaging( boolean skipPaging ); Integer getFirstResult(); Query setFirstResult( Integer firstResult ); Integer getMaxResults(); Query setMaxResults( Integer maxResults ); Junction.Type getRootJunctionType(); boolean isPlannedQuery(); Query setPlannedQuery( boolean plannedQuery ); Defaults getDefaults(); Query setDefaults( Defaults defaults ); List<? extends IdentifiableObject> getObjects(); Query setObjects( List<? extends IdentifiableObject> objects ); Query addOrder( Order... orders ); Query addOrders( Collection<Order> orders ); Disjunction addDisjunction(); Disjunction disjunction(); Conjunction addConjunction(); Conjunction conjunction(); Query forceDefaultOrder(); Query setDefaultOrder(); @Override String toString();  }
@Test public void validRestrictionParameters() { Query query = Query.from( createSchema() ); query.add( Restrictions.eq( "id", "anc" ) ); query.add( Restrictions.like( "name", "anc", MatchMode.ANYWHERE ) ); query.add( Restrictions.eq( "code", "anc" ) ); assertEquals( 3, query.getCriterions().size() ); }