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