public PaginatedList<CompanyDomain> listDomains(int page) {
		PaginatedList<CompanyDomain> results = new PaginatedList<CompanyDomain>();
		Criteria criteria = this.dao.newCriteria(CompanyDomain.class)
				.createAlias("company", "company", JoinType.INNER_JOIN)
				.addOrder(Order.asc("company.name")).addOrder(Order.asc("host"));
		if (page > 0)
			criteria.setFirstResult((page-1) * PAGESIZE).setMaxResults(PAGESIZE);
		Criteria counting = this.dao.newCriteria(CompanyDomain.class).setProjection(Projections.countDistinct("id"));
		results.setList(this.dao.findByCriteria(criteria, CompanyDomain.class));
		results.setTotal((Long) counting.uniqueResult());
		return results;
	}
public PaginatedList < CompanyDomain > listDomains ( int page ) { PaginatedList < CompanyDomain > results = new PaginatedList < CompanyDomain > ( ) ; Criteria criteria = this . dao . newCriteria ( CompanyDomain . class ) . createAlias ( "company" , "company" , JoinType . INNER_JOIN ) . addOrder ( Order . asc ( "company.name" ) ) . addOrder ( Order . asc ( "host" ) ) ; if ( page > 0 ) criteria . setFirstResult ( ( page - 1 ) * PAGESIZE ) . setMaxResults ( PAGESIZE ) ; Criteria counting = this . dao . newCriteria ( CompanyDomain . class ) . setProjection ( Projections . countDistinct ( "id" ) ) ; results . setList ( this . dao . findByCriteria ( criteria , CompanyDomain . class ) ) ; results . setTotal ( ( Long ) counting . uniqueResult ( ) ) ; return results ; }
Lista os domínios limitados a uma dada página

@param page número da página a ser listada
@return PaginatedList lista de domínios