generator-jhipster 7.8.0 → 7.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generators/client/templates/angular/package.json +5 -5
- package/generators/client/templates/common/package.json +1 -1
- package/generators/client/templates/react/package.json +8 -8
- package/generators/client/templates/vue/package.json +5 -5
- package/generators/common/templates/package.json +1 -1
- package/generators/entity-server/templates/src/main/java/package/repository/EntityRepositoryInternalImpl_reactive.java.ejs +10 -11
- package/generators/entity-server/templates/src/main/java/package/repository/EntityRepository_reactive.java.ejs +2 -2
- package/generators/generator-constants.js +1 -1
- package/generators/maven/templates/.mvn/wrapper/maven-wrapper.properties +3 -3
- package/generators/maven/templates/pom.xml.jhi.ejs +1 -1
- package/generators/server/templates/.mvn/wrapper/maven-wrapper.properties +3 -3
- package/generators/server/templates/pom.xml.ejs +1 -1
- package/generators/server/templates/src/main/java/package/repository/EntityManager.java.ejs +45 -35
- package/package.json +5 -5
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"@ng-bootstrap/ng-bootstrap": "12.0.1",
|
|
8
8
|
"@ngx-translate/core": "14.0.0",
|
|
9
9
|
"@ngx-translate/http-loader": "7.0.0",
|
|
10
|
-
"@popperjs/core": "2.11.
|
|
10
|
+
"@popperjs/core": "2.11.5",
|
|
11
11
|
"bootstrap": "5.1.3",
|
|
12
12
|
"bootswatch": "5.1.3",
|
|
13
13
|
"ngx-cookie-service": "13.1.2",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"@angular/cli": "13.3.1",
|
|
22
22
|
"@angular-builders/custom-webpack": "13.1.0",
|
|
23
23
|
"@angular-builders/jest": "13.0.3",
|
|
24
|
-
"@angular-eslint/eslint-plugin": "13.
|
|
24
|
+
"@angular-eslint/eslint-plugin": "13.2.0",
|
|
25
25
|
"@types/node": "16.11.26",
|
|
26
26
|
"@types/jest": "27.4.1",
|
|
27
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
27
|
+
"@typescript-eslint/eslint-plugin": "5.18.0",
|
|
28
28
|
"browser-sync": "2.27.9",
|
|
29
29
|
"browser-sync-webpack-plugin": "2.3.0",
|
|
30
30
|
"copy-webpack-plugin": "10.2.4",
|
|
@@ -35,14 +35,14 @@
|
|
|
35
35
|
"jest": "27.5.1",
|
|
36
36
|
"jest-preset-angular": "11.1.1",
|
|
37
37
|
"jest-date-mock": "1.0.8",
|
|
38
|
-
"jest-junit": "13.
|
|
38
|
+
"jest-junit": "13.1.0",
|
|
39
39
|
"jest-sonar-reporter": "2.0.0",
|
|
40
40
|
"merge-jsons-webpack-plugin": "2.0.1",
|
|
41
41
|
"postcss-rtlcss": "3.5.4",
|
|
42
42
|
"rimraf": "3.0.2",
|
|
43
43
|
"ts-jest": "27.1.4",
|
|
44
44
|
"typescript": "4.6.3",
|
|
45
|
-
"webpack": "5.
|
|
45
|
+
"webpack": "5.71.0",
|
|
46
46
|
"webpack-bundle-analyzer": "4.5.0",
|
|
47
47
|
"webpack-merge": "5.8.0",
|
|
48
48
|
"webpack-notifier": "1.15.0"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"react-hook-form": "7.29.0",
|
|
15
15
|
"react-jhipster": "0.20.0",
|
|
16
16
|
"react-loadable": "5.5.0",
|
|
17
|
-
"react-redux": "7.2.
|
|
17
|
+
"react-redux": "7.2.8",
|
|
18
18
|
"react-redux-loading-bar": "5.0.2",
|
|
19
19
|
"react-router-dom": "5.3.0",
|
|
20
20
|
"react-toastify": "8.2.0",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"@types/react-router-dom": "5.3.3",
|
|
38
38
|
"@types/redux": "3.6.31",
|
|
39
39
|
"@types/webpack-env": "1.16.3",
|
|
40
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
41
|
-
"@typescript-eslint/parser": "5.
|
|
40
|
+
"@typescript-eslint/eslint-plugin": "5.18.0",
|
|
41
|
+
"@typescript-eslint/parser": "5.18.0",
|
|
42
42
|
"autoprefixer": "10.4.4",
|
|
43
43
|
"browser-sync": "2.27.9",
|
|
44
44
|
"browser-sync-webpack-plugin": "2.3.0",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"eslint-plugin-react": "7.29.4",
|
|
53
53
|
"eslint-webpack-plugin": "3.1.1",
|
|
54
54
|
"folder-hash": "4.0.2",
|
|
55
|
-
"fork-ts-checker-webpack-plugin": "7.2.
|
|
55
|
+
"fork-ts-checker-webpack-plugin": "7.2.3",
|
|
56
56
|
"html-webpack-plugin": "5.5.0",
|
|
57
57
|
"identity-obj-proxy": "3.0.0",
|
|
58
58
|
"jest": "27.5.1",
|
|
59
|
-
"jest-junit": "13.
|
|
59
|
+
"jest-junit": "13.1.0",
|
|
60
60
|
"jest-sonar-reporter": "2.0.0",
|
|
61
61
|
"json-loader": "0.5.7",
|
|
62
62
|
"merge-jsons-webpack-plugin": "2.0.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"react-infinite-scroll-component": "6.1.0",
|
|
67
67
|
"redux-mock-store": "1.5.4",
|
|
68
68
|
"rimraf": "3.0.2",
|
|
69
|
-
"sass": "1.49.
|
|
69
|
+
"sass": "1.49.11",
|
|
70
70
|
"sass-loader": "12.6.0",
|
|
71
71
|
"simple-progress-webpack-plugin": "2.0.0",
|
|
72
72
|
"sinon": "13.0.1",
|
|
@@ -78,9 +78,9 @@
|
|
|
78
78
|
"ts-jest": "27.1.4",
|
|
79
79
|
"ts-loader": "9.2.8",
|
|
80
80
|
"typescript": "4.6.3",
|
|
81
|
-
"webpack": "5.
|
|
81
|
+
"webpack": "5.71.0",
|
|
82
82
|
"webpack-cli": "4.9.2",
|
|
83
|
-
"webpack-dev-server": "4.
|
|
83
|
+
"webpack-dev-server": "4.8.0",
|
|
84
84
|
"webpack-merge": "5.8.0",
|
|
85
85
|
"webpack-notifier": "1.15.0",
|
|
86
86
|
"workbox-webpack-plugin": "6.5.2"
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"css-loader": "6.7.1",
|
|
36
36
|
"css-minimizer-webpack-plugin": "3.4.1",
|
|
37
37
|
"folder-hash": "4.0.2",
|
|
38
|
-
"fork-ts-checker-webpack-plugin": "7.2.
|
|
38
|
+
"fork-ts-checker-webpack-plugin": "7.2.3",
|
|
39
39
|
"html-webpack-plugin": "5.5.0",
|
|
40
40
|
"jest": "27.5.1",
|
|
41
|
-
"jest-junit": "13.
|
|
41
|
+
"jest-junit": "13.1.0",
|
|
42
42
|
"jest-serializer-vue": "2.0.2",
|
|
43
43
|
"jest-sonar-reporter": "2.0.0",
|
|
44
44
|
"jest-vue-preprocessor": "1.7.1",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"postcss-loader": "6.2.1",
|
|
50
50
|
"postcss-url": "10.1.3",
|
|
51
51
|
"rimraf": "3.0.2",
|
|
52
|
-
"sass": "1.49.
|
|
52
|
+
"sass": "1.49.11",
|
|
53
53
|
"sass-loader": "12.6.0",
|
|
54
54
|
"sinon": "13.0.1",
|
|
55
55
|
"terser-webpack-plugin": "5.3.1",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"eslint-plugin-prettier": "4.0.0",
|
|
60
60
|
"eslint-plugin-vue": "8.5.0",
|
|
61
61
|
"typescript": "4.6.3",
|
|
62
|
-
"webpack": "5.
|
|
62
|
+
"webpack": "5.71.0",
|
|
63
63
|
"webpack-bundle-analyzer": "4.5.0",
|
|
64
64
|
"webpack-cli": "4.9.2",
|
|
65
|
-
"webpack-dev-server": "4.
|
|
65
|
+
"webpack-dev-server": "4.8.0",
|
|
66
66
|
"webpack-merge": "5.8.0",
|
|
67
67
|
"workbox-webpack-plugin": "6.5.2",
|
|
68
68
|
"vue-jest": "3.0.7",
|
|
@@ -50,6 +50,9 @@ import org.springframework.data.r2dbc.core.R2dbcEntityTemplate;
|
|
|
50
50
|
import org.springframework.data.r2dbc.repository.support.SimpleR2dbcRepository;
|
|
51
51
|
import org.springframework.data.relational.core.query.Criteria;
|
|
52
52
|
import org.springframework.data.relational.core.sql.Column;
|
|
53
|
+
import org.springframework.data.relational.core.sql.Comparison;
|
|
54
|
+
import org.springframework.data.relational.core.sql.Condition;
|
|
55
|
+
import org.springframework.data.relational.core.sql.Conditions;
|
|
53
56
|
import org.springframework.data.relational.core.sql.Expression;
|
|
54
57
|
import org.springframework.data.relational.core.sql.Select;
|
|
55
58
|
import org.springframework.data.relational.core.sql.SelectBuilder.SelectFromAndJoin<% if (reactiveEagerRelations.length > 0) { %>Condition<% } %>;
|
|
@@ -121,15 +124,10 @@ _%>
|
|
|
121
124
|
|
|
122
125
|
@Override
|
|
123
126
|
public Flux<<%= persistClass %>> findAllBy(Pageable pageable) {
|
|
124
|
-
return
|
|
127
|
+
return createQuery(pageable, null).all();
|
|
125
128
|
}
|
|
126
129
|
|
|
127
|
-
|
|
128
|
-
public Flux<<%= persistClass %>> findAllBy(Pageable pageable, Criteria criteria) {
|
|
129
|
-
return createQuery(pageable, criteria).all();
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
RowsFetchSpec<<%= persistClass %>> createQuery(Pageable pageable, Criteria criteria) {
|
|
130
|
+
RowsFetchSpec<<%= persistClass %>> createQuery(Pageable pageable, Condition whereClause) {
|
|
133
131
|
List<Expression> columns = <%= entityClass %>SqlHelper.getColumns(entityTable, EntityManager.ENTITY_ALIAS);
|
|
134
132
|
<%_ reactiveEagerRelations.forEach(function(rel) { _%>
|
|
135
133
|
columns.addAll(<%= rel.otherEntityNameCapitalized %>SqlHelper.getColumns(<%= rel.relationshipName %>Table, "<%= rel.relationshipName %>"));
|
|
@@ -138,19 +136,20 @@ _%>
|
|
|
138
136
|
<%_ reactiveEagerRelations.forEach(function(rel) { _%>
|
|
139
137
|
.leftOuterJoin(<%= rel.relationshipName %>Table).on(Column.create("<%= rel.joinColumnNames[0] %>", entityTable)).equals(Column.create("<%= rel.otherEntity.primaryKey.fields[0].columnName %>", <%= rel.relationshipName %>Table ))
|
|
140
138
|
<%_ }); _%>;
|
|
141
|
-
|
|
142
|
-
String select = entityManager.createSelect(selectFrom, <%= persistClass %>.class, pageable,
|
|
139
|
+
// we do not support Criteria here for now as of https://github.com/jhipster/generator-jhipster/issues/18269
|
|
140
|
+
String select = entityManager.createSelect(selectFrom, <%= persistClass %>.class, pageable, whereClause);
|
|
143
141
|
return db.sql(select).map(this::process);
|
|
144
142
|
}
|
|
145
143
|
|
|
146
144
|
@Override
|
|
147
145
|
public Flux<<%= persistClass %>> findAll() {
|
|
148
|
-
return findAllBy(null
|
|
146
|
+
return findAllBy(null);
|
|
149
147
|
}
|
|
150
148
|
|
|
151
149
|
@Override
|
|
152
150
|
public Mono<<%= persistClass %>> findById(<%= primaryKey.type %> id) {
|
|
153
|
-
|
|
151
|
+
Comparison whereClause = Conditions.isEqual(entityTable.column("<%= primaryKey.fields[0].columnName %>"), Conditions.just(id.toString()));
|
|
152
|
+
return createQuery(null, whereClause).one();
|
|
154
153
|
}
|
|
155
154
|
|
|
156
155
|
<%_ if (implementsEagerLoadApis) { _%>
|
|
@@ -144,8 +144,8 @@ interface <%= entityClass %>RepositoryInternal {
|
|
|
144
144
|
Flux<<%= persistClass %>> findAll();
|
|
145
145
|
|
|
146
146
|
Mono<<%= persistClass %>> findById(<%= primaryKey.type %> id);
|
|
147
|
-
|
|
148
|
-
Flux<<%= persistClass %>> findAllBy(Pageable pageable, Criteria criteria);
|
|
147
|
+
// this is not supported at the moment because of https://github.com/jhipster/generator-jhipster/issues/18269
|
|
148
|
+
// Flux<<%= persistClass %>> findAllBy(Pageable pageable, Criteria criteria);
|
|
149
149
|
|
|
150
150
|
<%_ if (implementsEagerLoadApis) { _%>
|
|
151
151
|
|
|
@@ -35,7 +35,7 @@ const GRADLE_VERSION = gradleOptions.GRADLE_VERSION;
|
|
|
35
35
|
const JIB_VERSION = '3.2.1';
|
|
36
36
|
|
|
37
37
|
// Libraries version
|
|
38
|
-
const JHIPSTER_DEPENDENCIES_VERSION = '7.8.
|
|
38
|
+
const JHIPSTER_DEPENDENCIES_VERSION = '7.8.1';
|
|
39
39
|
// The spring-boot version should match the one managed by https://mvnrepository.com/artifact/tech.jhipster/jhipster-dependencies/JHIPSTER_DEPENDENCIES_VERSION
|
|
40
40
|
const SPRING_BOOT_VERSION = '2.6.6';
|
|
41
41
|
const LIQUIBASE_VERSION = '4.6.1';
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
# to you under the Apache License, Version 2.0 (the
|
|
6
6
|
# "License"); you may not use this file except in compliance
|
|
7
7
|
# with the License. You may obtain a copy of the License at
|
|
8
|
-
#
|
|
8
|
+
#
|
|
9
9
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
10
|
+
#
|
|
11
11
|
# Unless required by applicable law or agreed to in writing,
|
|
12
12
|
# software distributed under the License is distributed on an
|
|
13
13
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
14
|
# KIND, either express or implied. See the License for the
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
|
-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.
|
|
17
|
+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip
|
|
18
18
|
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
<properties>
|
|
60
60
|
<java.version><%= JAVA_VERSION %></java.version>
|
|
61
61
|
|
|
62
|
-
<compiler-plugin.version>3.
|
|
62
|
+
<compiler-plugin.version>3.9.0</compiler-plugin.version>
|
|
63
63
|
<surefire-plugin.version>3.0.0-M5</surefire-plugin.version>
|
|
64
64
|
<&- fragments.propertiesSection() -&>
|
|
65
65
|
</properties>
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
# to you under the Apache License, Version 2.0 (the
|
|
6
6
|
# "License"); you may not use this file except in compliance
|
|
7
7
|
# with the License. You may obtain a copy of the License at
|
|
8
|
-
#
|
|
8
|
+
#
|
|
9
9
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
#
|
|
10
|
+
#
|
|
11
11
|
# Unless required by applicable law or agreed to in writing,
|
|
12
12
|
# software distributed under the License is distributed on an
|
|
13
13
|
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
14
|
# KIND, either express or implied. See the License for the
|
|
15
15
|
# specific language governing permissions and limitations
|
|
16
16
|
# under the License.
|
|
17
|
-
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.
|
|
17
|
+
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.5/apache-maven-3.8.5-bin.zip
|
|
18
18
|
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.1.0/maven-wrapper-3.1.0.jar
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
|
|
65
65
|
<properties>
|
|
66
66
|
<!-- Build properties -->
|
|
67
|
-
<maven.version>3.8.
|
|
67
|
+
<maven.version>3.8.5</maven.version>
|
|
68
68
|
<java.version><%= JAVA_VERSION %></java.version>
|
|
69
69
|
<%_ if (!skipClient) { _%>
|
|
70
70
|
<node.version>v<%= NODE_VERSION %></node.version>
|
|
@@ -33,6 +33,7 @@ import org.springframework.data.r2dbc.core.StatementMapper;
|
|
|
33
33
|
import org.springframework.data.r2dbc.mapping.OutboundRow;
|
|
34
34
|
import org.springframework.data.r2dbc.query.UpdateMapper;
|
|
35
35
|
import org.springframework.data.relational.core.query.Criteria;
|
|
36
|
+
import org.springframework.data.relational.core.sql.Condition;
|
|
36
37
|
import org.springframework.data.relational.core.mapping.RelationalPersistentEntity;
|
|
37
38
|
import org.springframework.data.relational.core.sql.Conditions;
|
|
38
39
|
import org.springframework.data.relational.core.sql.OrderByField;
|
|
@@ -90,19 +91,28 @@ public class EntityManager {
|
|
|
90
91
|
* Creates an SQL select statement from the given fragment and pagination parameters.
|
|
91
92
|
* @param selectFrom a representation of a select statement.
|
|
92
93
|
* @param entityType the entity type which holds the table name.
|
|
93
|
-
* @param pageable page parameter, or null, if everything needs to be returned
|
|
94
|
+
* @param pageable page parameter, or null, if everything needs to be returned.
|
|
95
|
+
* @param where condition or null. The condition to apply as where clause.
|
|
94
96
|
* @return sql select statement
|
|
95
97
|
*/
|
|
96
|
-
public String createSelect(SelectFromAndJoin selectFrom, Class<?> entityType, Pageable pageable,
|
|
98
|
+
public String createSelect(SelectFromAndJoin selectFrom, Class<?> entityType, Pageable pageable, Condition where) {
|
|
97
99
|
if (pageable != null) {
|
|
98
|
-
if (
|
|
99
|
-
return createSelectImpl(
|
|
100
|
+
if (where != null) {
|
|
101
|
+
return createSelectImpl(
|
|
102
|
+
selectFrom.limitOffset(pageable.getPageSize(), pageable.getOffset()).where(where),
|
|
103
|
+
entityType,
|
|
104
|
+
pageable.getSort()
|
|
105
|
+
);
|
|
100
106
|
} else {
|
|
101
|
-
return createSelectImpl(
|
|
107
|
+
return createSelectImpl(
|
|
108
|
+
selectFrom.limitOffset(pageable.getPageSize(), pageable.getOffset()),
|
|
109
|
+
entityType,
|
|
110
|
+
pageable.getSort()
|
|
111
|
+
);
|
|
102
112
|
}
|
|
103
113
|
} else {
|
|
104
|
-
if (
|
|
105
|
-
return createSelectImpl(selectFrom.where(
|
|
114
|
+
if (where != null) {
|
|
115
|
+
return createSelectImpl(selectFrom.where(where), entityType, null);
|
|
106
116
|
} else {
|
|
107
117
|
return createSelectImpl(selectFrom, entityType, null);
|
|
108
118
|
}
|
|
@@ -114,37 +124,32 @@ public class EntityManager {
|
|
|
114
124
|
* @param selectFrom a representation of a select statement.
|
|
115
125
|
* @param entityType the entity type which holds the table name.
|
|
116
126
|
* @param pageable page parameter, or null, if everything needs to be returned
|
|
127
|
+
* @param where condition or null. The condition to apply as where clause.
|
|
117
128
|
* @return sql select statement
|
|
118
129
|
*/
|
|
119
|
-
public String createSelect(SelectFromAndJoinCondition selectFrom, Class<?> entityType, Pageable pageable,
|
|
130
|
+
public String createSelect(SelectFromAndJoinCondition selectFrom, Class<?> entityType, Pageable pageable, Condition where) {
|
|
120
131
|
if (pageable != null) {
|
|
121
|
-
if (
|
|
122
|
-
return createSelectImpl(selectFrom.limitOffset(pageable.getPageSize(), pageable.getOffset()).where(
|
|
132
|
+
if (where != null) {
|
|
133
|
+
return createSelectImpl(selectFrom.limitOffset(pageable.getPageSize(), pageable.getOffset()).where(where), entityType, pageable.getSort());
|
|
123
134
|
} else {
|
|
124
135
|
return createSelectImpl(selectFrom.limitOffset(pageable.getPageSize(), pageable.getOffset()), entityType, pageable.getSort());
|
|
125
136
|
}
|
|
126
137
|
} else {
|
|
127
|
-
if (
|
|
128
|
-
return createSelectImpl(selectFrom.where(
|
|
138
|
+
if (where != null) {
|
|
139
|
+
return createSelectImpl(selectFrom.where(where), entityType, null);
|
|
129
140
|
} else {
|
|
130
141
|
return createSelectImpl(selectFrom, entityType, null);
|
|
131
142
|
}
|
|
132
143
|
}
|
|
133
144
|
}
|
|
134
145
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
}
|
|
143
|
-
return createSelect(selectFrom.build());
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
private RelationalPersistentEntity<?> getPersistentEntity(Class<?> entityType) {
|
|
147
|
-
return r2dbcEntityTemplate.getConverter().getMappingContext().getPersistentEntity(entityType);
|
|
146
|
+
/**
|
|
147
|
+
* Generate an actual SQL from the given {@link Select}.
|
|
148
|
+
* @param select a representation of a select statement.
|
|
149
|
+
* @return the generated SQL select.
|
|
150
|
+
*/
|
|
151
|
+
public String createSelect(Select select) {
|
|
152
|
+
return sqlRenderer.render(select);
|
|
148
153
|
}
|
|
149
154
|
|
|
150
155
|
/**
|
|
@@ -166,15 +171,6 @@ public class EntityManager {
|
|
|
166
171
|
return r2dbcEntityTemplate.getDatabaseClient().sql(statementMapper.getMappedObject(delete)).fetch().rowsUpdated();
|
|
167
172
|
}
|
|
168
173
|
|
|
169
|
-
/**
|
|
170
|
-
* Generate an actual SQL from the given {@link Select}.
|
|
171
|
-
* @param select a representation of a select statement.
|
|
172
|
-
* @return the generated SQL select.
|
|
173
|
-
*/
|
|
174
|
-
public String createSelect(Select select) {
|
|
175
|
-
return sqlRenderer.render(select);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
174
|
/**
|
|
179
175
|
* Inserts the given entity into the database - and sets the id, if it's an autoincrement field.
|
|
180
176
|
* @param <S> the type of the persisted entity.
|
|
@@ -222,6 +218,21 @@ public class EntityManager {
|
|
|
222
218
|
return r2dbcEntityTemplate.getDatabaseClient().sql(statementMapper.getMappedObject(deleteSpec)).then();
|
|
223
219
|
}
|
|
224
220
|
|
|
221
|
+
private String createSelectImpl(SelectOrdered selectFrom, Class<?> entityType, Sort sortParameter) {
|
|
222
|
+
if (sortParameter != null && sortParameter.isSorted()) {
|
|
223
|
+
RelationalPersistentEntity<?> entity = getPersistentEntity(entityType);
|
|
224
|
+
if (entity != null) {
|
|
225
|
+
Sort sort = updateMapper.getMappedObject(sortParameter, entity);
|
|
226
|
+
selectFrom = selectFrom.orderBy(createOrderByFields(Table.create(entity.getTableName()).as(EntityManager.ENTITY_ALIAS), sort));
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return createSelect(selectFrom.build());
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
private RelationalPersistentEntity<?> getPersistentEntity(Class<?> entityType) {
|
|
233
|
+
return r2dbcEntityTemplate.getConverter().getMappingContext().getPersistentEntity(entityType);
|
|
234
|
+
}
|
|
235
|
+
|
|
225
236
|
private static Collection<? extends OrderByField> createOrderByFields(Table table, Sort sortToUse) {
|
|
226
237
|
|
|
227
238
|
List<OrderByField> fields = new ArrayList<>();
|
|
@@ -236,5 +247,4 @@ public class EntityManager {
|
|
|
236
247
|
|
|
237
248
|
return fields;
|
|
238
249
|
}
|
|
239
|
-
|
|
240
250
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "generator-jhipster",
|
|
3
|
-
"version": "7.8.
|
|
3
|
+
"version": "7.8.1",
|
|
4
4
|
"description": "Spring Boot + Angular/React/Vue in one handy generator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"yeoman-generator",
|
|
@@ -84,12 +84,12 @@
|
|
|
84
84
|
},
|
|
85
85
|
"dependencies": {
|
|
86
86
|
"@faker-js/faker": "5.5.3",
|
|
87
|
-
"aws-sdk": "2.
|
|
87
|
+
"aws-sdk": "2.1106.0",
|
|
88
88
|
"axios": "0.26.1",
|
|
89
89
|
"chalk": "4.1.2",
|
|
90
90
|
"chevrotain": "10.1.2",
|
|
91
91
|
"commander": "9.1.0",
|
|
92
|
-
"conf": "10.1.
|
|
92
|
+
"conf": "10.1.2",
|
|
93
93
|
"debug": "4.3.4",
|
|
94
94
|
"didyoumean": "1.2.2",
|
|
95
95
|
"ejs": "3.1.6",
|
|
@@ -105,14 +105,14 @@
|
|
|
105
105
|
"p-transform": "1.3.0",
|
|
106
106
|
"parse-gitignore": "1.0.1",
|
|
107
107
|
"pluralize": "8.0.0",
|
|
108
|
-
"prettier": "2.6.
|
|
108
|
+
"prettier": "2.6.2",
|
|
109
109
|
"prettier-plugin-java": "1.6.1",
|
|
110
110
|
"prettier-plugin-packagejson": "2.2.17",
|
|
111
111
|
"progress": "2.0.3",
|
|
112
112
|
"randexp": "0.5.3",
|
|
113
113
|
"semver": "7.3.5",
|
|
114
114
|
"shelljs": "0.8.5",
|
|
115
|
-
"simple-git": "3.
|
|
115
|
+
"simple-git": "3.5.0",
|
|
116
116
|
"then-request": "6.0.2",
|
|
117
117
|
"uuid": "8.3.2",
|
|
118
118
|
"winston": "3.6.0",
|