-
-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathGeneric2Test.java
More file actions
54 lines (42 loc) · 1.12 KB
/
Generic2Test.java
File metadata and controls
54 lines (42 loc) · 1.12 KB
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
package com.querydsl.apt.domain;
import jakarta.persistence.Embedded;
import jakarta.persistence.Entity;
import jakarta.persistence.MappedSuperclass;
import java.io.Serializable;
import org.junit.Test;
public class Generic2Test extends AbstractTest {
public static class Range<T extends Comparable<? super T>> {
private T min;
private T max;
public T getMin() {
return min;
}
public void setMin(T min) {
this.min = min;
}
public T getMax() {
return max;
}
public void setMax(T max) {
this.max = max;
}
}
@MappedSuperclass
public abstract static class BaseEntity<T extends Comparable<? super T>> implements Serializable {
@Embedded private Range<T> range;
public Range<T> getRange() {
return range;
}
public void setRange(Range<T> range) {
this.range = range;
}
}
@Entity
public static class Foo extends BaseEntity<Integer> {}
@Test
public void test() throws NoSuchFieldException {
start(QGeneric2Test_Foo.class, QGeneric2Test_Foo.foo);
assertPresent("range");
match(QGeneric2Test_Range.class, "range");
}
}