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