Skip to content

Package: QueryAttribute

QueryAttribute

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.NonJPA;
21: import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraint;
22:
23: /**
24: * Represents an attribute of a Java type that is defined by a query.
25: *
26: * @param <X> The represented type that contains the attribute
27: * @param <Y> The type of the represented attribute
28: */
29: public interface QueryAttribute<X, Y> extends FieldSpecification<X, Y> {
30:
31: /**
32: * Return the entire query as inserted into {@link cz.cvut.kbss.jopa.model.annotations.Sparql}.
33: *
34: * @return Query defining this attribute
35: */
36: @NonJPA
37: String getQuery();
38:
39: /**
40: * Whether referencing other entity attributes is enabled.
41: *
42: * @return {@code true} when other entity attributes may be referenced from the query
43: */
44: @NonJPA
45: boolean enableReferencingAttributes();
46:
47: /**
48: * Return the java.lang.reflect.Member for the represented attribute.
49: *
50: * @return corresponding java.lang.reflect.Member
51: */
52: java.lang.reflect.Member getJavaMember();
53:
54: /**
55: * Returns participation constraints specified for this attribute.
56: *
57: * @return Array of participation constraints
58: */
59: ParticipationConstraint[] getConstraints();
60: }