-
Notifications
You must be signed in to change notification settings - Fork 14
/
AbstractQueryAttribute.java
85 lines (67 loc) · 1.77 KB
/
AbstractQueryAttribute.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
package cz.cvut.kbss.jopa.model.metamodel;
import cz.cvut.kbss.jopa.model.annotations.FetchType;
import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraint;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
public abstract class AbstractQueryAttribute<X, Y> implements QueryAttribute<X, Y> {
private final String query;
private final Field field;
private final ManagedType<X> declaringType;
private final ParticipationConstraint[] constraints;
public AbstractQueryAttribute(String query, Field field, ManagedType<X> declaringType, ParticipationConstraint[] constraints) {
this.query = query;
this.field = field;
this.declaringType = declaringType;
this.constraints = constraints;
}
@Override
public String getQuery() {
return query;
}
@Override
public Member getJavaMember() {
return field;
}
@Override
public ParticipationConstraint[] getConstraints() {
return constraints;
}
@Override
public ManagedType<X> getDeclaringType() {
return declaringType;
}
@Override
public Field getJavaField() {
return field;
}
@Override
public FetchType getFetchType() {
return null;
}
/**
* A query based attribute is always inferred.
*
* @return always {@code true}
*/
@Override
public boolean isInferred() {
return true;
}
/**
* A query based attribute always includes explicit.
*
* @return always {@code true}
*/
@Override
public boolean includeExplicit() {
return true;
}
@Override
public String getName() {
return null;
}
@Override
public boolean isCollection() {
return false;
}
}