Statement filterStatement =
new StatementBuilder("WHERE type = :type ORDER BY name LIMIT 500")
.putValue("type", CompanyType.ADVERTISER.toString()).toStatement();
// Get companies by statement.
CompanyPage page = companyService.getCompaniesByStatement(filterStatement);
if (page.getResults() != null) {
int i = page.getStartIndex();
for (Company company : page.getResults()) {
System.out.println(i + ") Company with ID \"" + company.getId()
+ "\", name \"" + company.getName()
+ "\", and type \"" + company.getType() + "\" was found.");
i++;
}
}
System.out.println("Number of results found: " + page.getTotalResultSetSize());
} catch (Exception e) {
e.printStackTrace();
}
}