@Override
public Collection<LogEntry> query(Query query, String viewlogprivileges, String capriviledges, int maxResults) throws IllegalQueryException {
log.trace(">query()");
if (capriviledges == null || capriviledges.length() == 0 || !query.isLegalQuery()) {
throw new IllegalQueryException();
}
List<LogEntryData> logEntryDataList = LogEntryData.findByCustomQueryAndPrivileges(entityManager, query.getQueryString(), capriviledges, viewlogprivileges, maxResults+1);
List<LogEntry> returnval = new ArrayList<LogEntry>();
for (LogEntryData logEntryData : logEntryDataList) {
LogEntry logEntry = logEntryData.getLogEntry();