Skip to content

Commit 2397f5a

Browse files
committed
Create specifi jdl for oauth
1 parent cf85a6c commit 2397f5a

File tree

5 files changed

+368
-7
lines changed

5 files changed

+368
-7
lines changed

.blueprint/generate-sample/generator.mjs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,18 @@ export default class extends BaseGenerator {
6060
}
6161
},
6262
async jdlEntities() {
63-
if (this.withEntities) {
63+
if (this.withEntities) {
6464
if (this.sampleName.includes('-mongo-')) {
65-
this.jdlSample = 'app_mongo.jdl';
65+
this.jdlSample = 'app_mongo';
6666
} else if (this.sampleName.includes('-react-')) {
67-
this.jdlSample = 'app-react.jdl';
67+
this.jdlSample = 'app-react';
6868
} else {
69-
this.jdlSample = 'app.jdl';
69+
this.jdlSample = 'app';
7070
}
71+
if (this.sampleName.includes('oauth-')) {
72+
this.jdlSample = this.jdlSample+'_oauth';
73+
}
74+
this.jdlSample = this.jdlSample+'.jdl';
7175
this.copyTemplate(`samples/jdl-default/${this.jdlSample}`, this.jdlSample, { noGlob: true });
7276
}
7377
},
Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
entity Region {
2+
regionName String
3+
}
4+
5+
entity Country {
6+
countryName String
7+
}
8+
9+
// an ignored comment
10+
/** not an ignored comment */
11+
entity Location {
12+
streetAddress String,
13+
postalCode String,
14+
city String,
15+
stateProvince String
16+
}
17+
18+
entity Department {
19+
departmentName String required
20+
}
21+
22+
/**
23+
* PieceOfWork entity.
24+
* @author The JHipster team.
25+
*/
26+
entity PieceOfWork {
27+
title String,
28+
description String
29+
}
30+
31+
/**
32+
* The Employee entity.
33+
*/
34+
entity Employee {
35+
/**
36+
* The firstname attribute.
37+
*/
38+
firstName String,
39+
lastName String,
40+
email String,
41+
phoneNumber String,
42+
hireDate Instant,
43+
salary Long,
44+
commissionPct Long
45+
}
46+
47+
entity Job {
48+
jobTitle String,
49+
minSalary Long,
50+
maxSalary Long
51+
}
52+
53+
entity JobHistory {
54+
startDate Instant,
55+
endDate Instant,
56+
language Language
57+
}
58+
59+
enum Language {
60+
FRENCH, ENGLISH, SPANISH
61+
}
62+
63+
relationship OneToOne {
64+
Country{region} to Region
65+
}
66+
67+
relationship OneToOne {
68+
Location{country} to Country
69+
}
70+
71+
relationship OneToOne {
72+
Department{location} to Location
73+
}
74+
75+
// defining multiple OneToMany relationships with comments
76+
relationship OneToMany {
77+
Employee to Job{employee},
78+
/**
79+
* A relationship
80+
*/
81+
Department to
82+
/**
83+
* Another side of the same relationship
84+
*/
85+
Employee{department}
86+
}
87+
88+
relationship ManyToOne {
89+
Employee{manager} to Employee
90+
}
91+
92+
// defining multiple oneToOne relationships
93+
relationship OneToOne {
94+
JobHistory{job} to Job,
95+
JobHistory{department} to Department,
96+
JobHistory{employee} to Employee
97+
}
98+
99+
relationship ManyToMany {
100+
Job{chore(title)} to PieceOfWork{job}
101+
}
102+
103+
// Set pagination options
104+
// .Net does not generates link header for pagination.
105+
// paginate JobHistory, Employee with infinite-scroll
106+
// paginate Job with pagination
107+
108+
// Use Data Transfert Objects (DTO)
109+
dto * with mapstruct
110+
111+
// Set service options to all except few
112+
service all with serviceImpl except Employee, Job
113+
114+
// Set an angular suffix
115+
// angularSuffix * with mySuffix
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
entity Region {
2+
regionName String
3+
}
4+
5+
entity Country {
6+
countryName String
7+
}
8+
9+
// an ignored comment
10+
/** not an ignored comment */
11+
entity Location {
12+
streetAddress String,
13+
postalCode String,
14+
city String,
15+
stateProvince String
16+
}
17+
18+
entity Department {
19+
departmentName String required
20+
}
21+
22+
/**
23+
* PieceOfWork entity.
24+
* @author The JHipster team.
25+
*/
26+
entity PieceOfWork {
27+
title String,
28+
description String
29+
}
30+
31+
/**
32+
* The Employee entity.
33+
*/
34+
entity Employee {
35+
/**
36+
* The firstname attribute.
37+
*/
38+
firstName String,
39+
lastName String,
40+
email String,
41+
phoneNumber String,
42+
hireDate Instant,
43+
salary Long,
44+
commissionPct Long
45+
}
46+
47+
entity Job {
48+
jobTitle String,
49+
minSalary Long,
50+
maxSalary Long
51+
}
52+
53+
entity JobHistory {
54+
startDate Instant,
55+
endDate Instant,
56+
language Language
57+
}
58+
59+
enum Language {
60+
FRENCH, ENGLISH, SPANISH
61+
}
62+
63+
relationship OneToOne {
64+
Country{region} to Region
65+
}
66+
67+
relationship OneToOne {
68+
Location{country} to Country
69+
}
70+
71+
relationship OneToOne {
72+
Department{location} to Location
73+
}
74+
75+
// defining multiple OneToMany relationships with comments
76+
relationship OneToMany {
77+
Employee to Job{employee},
78+
/**
79+
* A relationship
80+
*/
81+
Department to
82+
/**
83+
* Another side of the same relationship
84+
*/
85+
Employee{department}
86+
}
87+
88+
relationship ManyToOne {
89+
Employee{manager} to Employee
90+
}
91+
92+
// defining multiple oneToOne relationships
93+
relationship OneToOne {
94+
JobHistory{job} to Job,
95+
JobHistory{department} to Department,
96+
JobHistory{employee} to Employee
97+
}
98+
99+
relationship ManyToMany {
100+
Job{chore(title)} to PieceOfWork{job}
101+
}
102+
103+
// Set pagination options
104+
paginate * with pagination
105+
106+
// Use Data Transfert Objects (DTO)
107+
dto * with mapstruct
108+
109+
// Set service options to all except few
110+
service all with serviceImpl except Employee, Job
111+
112+
// Set an angular suffix
113+
// angularSuffix * with mySuffix
Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
entity Region {
2+
regionName String
3+
}
4+
5+
entity Country {
6+
countryName String
7+
}
8+
9+
// an ignored comment
10+
/** not an ignored comment */
11+
entity Location {
12+
streetAddress String,
13+
postalCode String,
14+
city String,
15+
stateProvince String
16+
}
17+
18+
entity Department {
19+
departmentName String required
20+
}
21+
22+
/**
23+
* PieceOfWork entity.
24+
* @author The JHipster team.
25+
*/
26+
entity PieceOfWork {
27+
title String,
28+
description String
29+
}
30+
31+
/**
32+
* The Employee entity.
33+
*/
34+
entity Employee {
35+
/**
36+
* The firstname attribute.
37+
*/
38+
firstName String,
39+
lastName String,
40+
email String,
41+
phoneNumber String,
42+
hireDate Instant,
43+
salary Long,
44+
commissionPct Long
45+
}
46+
47+
entity Job {
48+
jobTitle String,
49+
minSalary Long,
50+
maxSalary Long
51+
}
52+
53+
entity JobHistory {
54+
startDate Instant,
55+
endDate Instant,
56+
language Language
57+
}
58+
59+
entity TimeSheet {
60+
id UUID
61+
timeSheetDate LocalDate
62+
}
63+
64+
entity TimeSheetEntry {
65+
activityName String
66+
startTimeMilitary Integer
67+
endTimeMilitary Integer
68+
totalTime BigDecimal
69+
}
70+
71+
enum Language {
72+
FRENCH, ENGLISH, SPANISH
73+
}
74+
75+
76+
77+
relationship OneToOne {
78+
Country{region} to Region
79+
}
80+
81+
relationship OneToOne {
82+
Location{country} to Country
83+
}
84+
85+
relationship OneToOne {
86+
Department{location} to Location
87+
}
88+
89+
// defining multiple OneToMany relationships with comments
90+
relationship OneToMany {
91+
Employee to Job{employee},
92+
/**
93+
* A relationship
94+
*/
95+
Department to
96+
/**
97+
* Another side of the same relationship
98+
*/
99+
Employee{department}
100+
101+
Employee to TimeSheet{employee}
102+
103+
TimeSheet to TimeSheetEntry{timeSheet}
104+
}
105+
106+
relationship ManyToOne {
107+
Employee{manager} to Employee
108+
}
109+
110+
// defining multiple oneToOne relationships
111+
relationship OneToOne {
112+
JobHistory{job} to Job,
113+
JobHistory{department} to Department,
114+
JobHistory{employee} to Employee
115+
}
116+
117+
relationship ManyToMany {
118+
Job{chore(title)} to PieceOfWork{job}
119+
}
120+
121+
// Set pagination options
122+
paginate JobHistory, Employee with infinite-scroll
123+
paginate Job with pagination
124+
125+
// Use Data Transfert Objects (DTO)
126+
dto * with mapstruct
127+
128+
// Set service options to all except few
129+
service all with serviceImpl except Employee, Job
130+
131+
// Set an angular suffix
132+
// angularSuffix * with mySuffix

generators/dotnetcore/generator.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,6 @@ export default class extends BaseApplicationGenerator {
4545
if (this.jhipsterConfig.jwtSecretKey === undefined) {
4646
this.jhipsterConfig.jwtSecretKey = createBase64Secret(this.options.reproducibleTests);
4747
}
48-
if(this.jhipsterConfig.authenticationType === 'oauth2') {
49-
this.jhipsterConfig.syncUserWithIdp = true;
50-
}
5148
},
5249
});
5350
}

0 commit comments

Comments
 (0)