|
28 | 28 | import org.apache.syncope.common.lib.types.OpEvent; |
29 | 29 | import org.apache.syncope.core.persistence.api.dao.AuditEventDAO; |
30 | 30 | import org.apache.syncope.core.persistence.api.entity.AuditEvent; |
| 31 | +import org.apache.syncope.core.persistence.common.dao.AbstractAuditEventDAO; |
31 | 32 | import org.apache.syncope.core.persistence.neo4j.entity.Neo4jAuditEvent; |
32 | 33 | import org.apache.syncope.core.persistence.neo4j.spring.NodeValidator; |
33 | | -import org.slf4j.Logger; |
34 | | -import org.slf4j.LoggerFactory; |
35 | 34 | import org.springframework.data.domain.Pageable; |
| 35 | +import org.springframework.data.domain.Sort; |
36 | 36 | import org.springframework.data.neo4j.core.Neo4jClient; |
37 | 37 | import org.springframework.data.neo4j.core.Neo4jTemplate; |
38 | 38 | import org.springframework.transaction.annotation.Transactional; |
39 | 39 |
|
40 | | -public class Neo4jAuditEventDAO implements AuditEventDAO { |
41 | | - |
42 | | - protected static final Logger LOG = LoggerFactory.getLogger(AuditEventDAO.class); |
| 40 | +public class Neo4jAuditEventDAO extends AbstractAuditEventDAO implements AuditEventDAO { |
43 | 41 |
|
44 | 42 | protected static class AuditEventCriteriaBuilder { |
45 | 43 |
|
@@ -169,8 +167,9 @@ public List<AuditEventTO> search( |
169 | 167 | build() |
170 | 168 | + " RETURN n.id"); |
171 | 169 |
|
172 | | - if (!pageable.getSort().isEmpty()) { |
173 | | - query.append(" ORDER BY ").append(pageable.getSort().stream(). |
| 170 | + List<Sort.Order> orderBy = filterOrderBy(pageable.getSort().stream(), Neo4jAuditEvent.class); |
| 171 | + if (!orderBy.isEmpty()) { |
| 172 | + query.append(" ORDER BY ").append(orderBy.stream(). |
174 | 173 | map(clause -> "n." + clause.getProperty() + ' ' + clause.getDirection().name()). |
175 | 174 | collect(Collectors.joining(","))); |
176 | 175 | } |
|
0 commit comments