-
-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathQueryInit4Test.java
More file actions
69 lines (46 loc) · 1.37 KB
/
QueryInit4Test.java
File metadata and controls
69 lines (46 loc) · 1.37 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package com.querydsl.apt.domain;
import static org.assertj.core.api.Assertions.assertThat;
import com.querydsl.core.annotations.QueryEntity;
import com.querydsl.core.annotations.QueryInit;
import java.sql.Date;
import java.util.Set;
import org.junit.Test;
public class QueryInit4Test {
@QueryEntity
public static class Organization {}
@QueryEntity
public static class Application {}
@QueryEntity
public static class Tenant {
Long id;
String tenantBusinessKey;
String sourceSystemKey;
String tenantName;
@QueryInit({"user.primaryTenant", "tenant"})
Set<UserTenantApplication> userTenantApplications;
Set<Organization> organizations;
Date lastModifiedDate;
Long lastModifiedUserId;
}
@QueryEntity
public static class UserTenantApplication {
User user;
Tenant tenant;
Application application;
Date lastModifiedDate;
Long lastModifiedUserId;
}
@QueryEntity
public static class User {
Long id;
Tenant primaryTenant;
Set<UserTenantApplication> userTenantApplications;
}
@Test
public void test() {
var tenant = QQueryInit4Test_Tenant.tenant;
assertThat(tenant.userTenantApplications.any().user.id).isNotNull();
assertThat(tenant.userTenantApplications.any().tenant.id).isNotNull();
assertThat(tenant.userTenantApplications.any().user.primaryTenant.id).isNotNull();
}
}