Skip to content

Package: AbstractKapuaNamedQuery

AbstractKapuaNamedQuery

nameinstructionbranchcomplexitylinemethod
AbstractKapuaNamedQuery()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
AbstractKapuaNamedQuery(KapuaId)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
AbstractKapuaNamedQuery(KapuaQuery)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getDefaultSortCriteria()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2016, 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.commons.model.query;
14:
15: import org.eclipse.kapua.model.KapuaNamedEntity;
16: import org.eclipse.kapua.model.KapuaNamedEntityAttributes;
17: import org.eclipse.kapua.model.id.KapuaId;
18: import org.eclipse.kapua.model.query.KapuaQuery;
19: import org.eclipse.kapua.model.query.KapuaSortCriteria;
20: import org.eclipse.kapua.model.query.SortOrder;
21:
22: /**
23: * {@link KapuaQuery} {@code abstract} implementation for {@link KapuaNamedEntity}.
24: * <p>
25: * It default the {@link #getSortCriteria()} on the {@link KapuaNamedEntityAttributes#NAME}
26: *
27: * @since 1.5.0
28: */
29: public abstract class AbstractKapuaNamedQuery extends AbstractKapuaQuery implements KapuaQuery {
30:
31: /**
32: * Constructor.
33: *
34: * @since 1.5.0
35: */
36: public AbstractKapuaNamedQuery() {
37: super();
38: }
39:
40: /**
41: * Constructor.
42: *
43: * @param scopeId The {@link #getScopeId()}.
44: * @since 1.5.0
45: */
46: public AbstractKapuaNamedQuery(KapuaId scopeId) {
47: super(scopeId);
48: }
49:
50: /**
51: * Clone constructor.
52: *
53: * @param query The {@link KapuaQuery} to clone.
54: * @since 1.5.0
55: */
56: public AbstractKapuaNamedQuery(KapuaQuery query) {
57: super(query);
58: }
59:
60: @Override
61: public KapuaSortCriteria getDefaultSortCriteria() {
62: return fieldSortCriteria(KapuaNamedEntityAttributes.NAME, SortOrder.ASCENDING);
63: }
64: }