Skip to content

Package: SingularQueryAttributeImpl

SingularQueryAttributeImpl

nameinstructionbranchcomplexitylinemethod
SingularQueryAttributeImpl(String, boolean, Field, ManagedType, FetchType, Type, ParticipationConstraint[], ConverterWrapper)
M: 0 C: 13
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 3
100%
M: 0 C: 1
100%
getJavaType()
M: 0 C: 4
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getType()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
isCollection()
M: 0 C: 2
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /**
2: * Copyright (C) 2022 Czech Technical University in Prague
3: *
4: * This program is free software: you can redistribute it and/or modify it under
5: * the terms of the GNU General Public License as published by the Free Software
6: * Foundation, either version 3 of the License, or (at your option) any
7: * later version.
8: *
9: * This program is distributed in the hope that it will be useful, but WITHOUT
10: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11: * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
12: * details. You should have received a copy of the GNU General Public License
13: * along with this program. If not, see <http://www.gnu.org/licenses/>.
14: */
15: package cz.cvut.kbss.jopa.model.metamodel;
16:
17: import cz.cvut.kbss.jopa.model.annotations.FetchType;
18: import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraint;
19: import cz.cvut.kbss.jopa.oom.converter.ConverterWrapper;
20:
21: import java.lang.reflect.Field;
22:
23: /**
24: * Singular query attributes contain a single value or reference, ie. they are not collections.
25: *
26: * @param <X> The represented type that contains the attribute
27: * @param <Y> The type of the represented attribute
28: */
29: public class SingularQueryAttributeImpl<X, Y> extends AbstractQueryAttribute<X, Y> implements SingularQueryAttribute<X, Y> {
30:
31: private final Type<Y> type;
32:
33: public SingularQueryAttributeImpl(String query, boolean enableReferencingAttributes, Field field,
34: ManagedType<X> declaringType, FetchType fetchType,
35: Type<Y> type, ParticipationConstraint[] constraints, ConverterWrapper converter) {
36: super(query, enableReferencingAttributes, field, declaringType, fetchType, constraints, converter);
37: this.type = type;
38: }
39:
40: @Override
41: public Type<Y> getType() {
42: return type;
43: }
44:
45: @Override
46: public Class<Y> getJavaType() {
47: return type.getJavaType();
48: }
49:
50: @Override
51: public boolean isCollection() {
52: return false;
53: }
54: }