generator-jhipster 8.0.0-rc.1 → 8.0.0
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/README.md +10 -1
- package/dist/cli/environment-builder.mjs +3 -3
- package/dist/cli/jhipster-command.mjs +7 -3
- package/dist/cli/program.mjs +1 -1
- package/dist/generators/angular/generator.mjs +8 -7
- package/dist/generators/angular/resources/package.json +10 -9
- package/dist/generators/angular/templates/package.json.ejs +4 -8
- package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/list/_entityFile_.component.html.ejs +6 -10
- package/dist/generators/angular/templates/src/main/webapp/app/entities/_entityFolder_/service/_entityFile_.service.ts.ejs +1 -1
- package/dist/generators/angular/templates/src/main/webapp/app/layouts/navbar/navbar.component.scss.ejs +1 -1
- package/dist/generators/angular/templates/webpack/webpack.microfrontend.js.ejs +48 -126
- package/dist/generators/app/support/config.mjs +3 -3
- package/dist/generators/base/generator.mjs +0 -3
- package/dist/generators/base/support/config.mjs +6 -6
- package/dist/generators/base/support/jhipster7-context.mjs +3 -3
- package/dist/generators/base-application/generator.mjs +2 -2
- package/dist/generators/base-application/support/enum.mjs +1 -1
- package/dist/generators/base-application/support/prepare-entity.mjs +14 -10
- package/dist/generators/base-application/support/prepare-field.mjs +11 -7
- package/dist/generators/base-application/support/prepare-relationship.mjs +12 -14
- package/dist/generators/base-workspaces/internal/docker-prompts.mjs +13 -12
- package/dist/generators/bootstrap/generator.mjs +64 -43
- package/dist/generators/bootstrap/support/auto-crlf-transform.mjs +34 -21
- package/dist/generators/bootstrap/support/eslint-transform.mjs +2 -5
- package/dist/generators/bootstrap/support/java-unused-imports-transform.mjs +2 -2
- package/dist/generators/bootstrap/support/multi-step-transform/index.mjs +17 -28
- package/dist/generators/bootstrap/support/multi-step-transform/template-file-fs.mjs +12 -6
- package/dist/generators/bootstrap/support/multi-step-transform/template-file.mjs +1 -0
- package/dist/generators/bootstrap/support/prettier-support.mjs +2 -2
- package/dist/generators/bootstrap-application/generator.mjs +10 -3
- package/dist/generators/bootstrap-application-base/generator.mjs +9 -6
- package/dist/generators/bootstrap-application-server/generator.mjs +2 -2
- package/dist/generators/client/resources/package.json +3 -3
- package/dist/generators/client/templates/src/main/webapp/content/css/loading.css.ejs +1 -1
- package/dist/generators/client/templates/webpack/webpack.microfrontend.js.jhi.ejs +14 -1
- package/dist/generators/common/files.mjs +1 -1
- package/dist/generators/common/generator.mjs +29 -7
- package/dist/generators/common/resources/package.json +3 -3
- package/dist/generators/common/templates/.lintstagedrc.cjs.ejs +21 -0
- package/dist/generators/common/templates/.prettierrc.ejs +1 -1
- package/dist/generators/common/templates/README.md.jhi.ejs +2 -0
- package/dist/generators/cypress/templates/src/test/javascript/cypress/e2e/account/settings-page.cy.ts.ejs +3 -0
- package/dist/generators/entity/prompts.mjs +123 -306
- package/dist/generators/generator-constants.mjs +5 -5
- package/dist/generators/heroku/generator.mjs +318 -595
- package/dist/generators/heroku/templates/Procfile.ejs +1 -1
- package/dist/generators/heroku/templates/application-heroku.yml.ejs +0 -12
- package/dist/generators/info/generator.mjs +6 -4
- package/dist/generators/init/generator.mjs +2 -2
- package/dist/generators/java/entity-files.mjs +1 -1
- package/dist/generators/java/generator.mjs +12 -13
- package/dist/generators/java/support/package-info-transform.mjs +20 -6
- package/dist/generators/java/templates/src/main/java/_package_/_entityPackage_/domain/_persistClass_.java.jhi.ejs +24 -28
- package/dist/generators/java/templates/src/main/java/_package_/_entityPackage_/domain/enumeration/_enumName_.java.ejs +3 -3
- package/dist/generators/java/templates/src/test/java/_package_/_entityPackage_/domain/_persistClass_Test.java.ejs +86 -8
- package/dist/generators/java/templates/src/test/java/_package_/_entityPackage_/domain/_persistClass_TestSamples.java.ejs +85 -0
- package/dist/generators/jdl/generator.mjs +14 -5
- package/dist/generators/kubernetes/templates/ingress.yml.ejs +0 -1
- package/dist/generators/languages/command.mjs +5 -0
- package/dist/generators/languages/generator.mjs +20 -13
- package/dist/generators/languages/translation-data.mjs +8 -13
- package/dist/generators/liquibase/generator.mjs +7 -3
- package/dist/generators/project-name/generator.mjs +1 -1
- package/dist/generators/react/generator.mjs +18 -10
- package/dist/generators/react/resources/package.json +19 -18
- package/dist/generators/react/templates/package.json.ejs +4 -5
- package/dist/generators/react/templates/src/main/webapp/app/config/icon-loader.ts.ejs +35 -33
- package/dist/generators/react/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_-update.tsx.ejs +7 -2
- package/dist/generators/react/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_.reducer.ts.ejs +1 -1
- package/dist/generators/react/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_.tsx.ejs +1 -1
- package/dist/generators/react/templates/src/main/webapp/app/modules/home/home.tsx.ejs +1 -1
- package/dist/generators/react/templates/src/main/webapp/app/routes.tsx.ejs +9 -2
- package/dist/generators/react/templates/src/main/webapp/app/shared/layout/header/header-components.tsx.ejs +1 -1
- package/dist/generators/react/templates/src/main/webapp/app/shared/layout/header/header.scss.ejs +5 -4
- package/dist/generators/react/templates/src/main/webapp/app/shared/layout/menus/entities.tsx.ejs +10 -1
- package/dist/generators/react/templates/tsconfig.test.json.ejs +1 -1
- package/dist/generators/react/templates/webpack/webpack.microfrontend.js.jhi.react.ejs +13 -58
- package/dist/generators/server/generator.mjs +13 -4
- package/dist/generators/server/resources/Dockerfile +7 -7
- package/dist/generators/server/resources/gradle/libs.versions.toml +1 -1
- package/dist/generators/server/resources/pom.xml +11 -11
- package/dist/generators/server/support/config.mjs +4 -4
- package/dist/generators/server/support/prepare-entity.mjs +5 -5
- package/dist/generators/server/support/prepare-field.mjs +20 -0
- package/dist/generators/server/support/relationship.mjs +2 -1
- package/dist/generators/server/support/templates/field-values.mjs +5 -2
- package/dist/generators/server/templates/README.md.jhi.spring-boot.ejs +0 -1
- package/dist/generators/server/templates/package.json.ejs +0 -5
- package/dist/generators/server/templates/pom.xml.ejs +1 -8
- package/dist/generators/server/templates/src/main/java/_package_/_entityPackage_/_partials_entity_/get_all_template.ejs +3 -3
- package/dist/generators/server/templates/src/main/java/_package_/_entityPackage_/service/dto/_dtoClass_.java.ejs +2 -2
- package/dist/generators/server/templates/src/main/java/_package_/_entityPackage_/web/rest/_entityClass_Resource.java.ejs +11 -11
- package/dist/generators/server/templates/src/main/java/_package_/config/JacksonConfiguration.java.ejs +2 -1
- package/dist/generators/server/templates/src/main/java/_package_/config/SecurityConfiguration_imperative.java.ejs +1 -1
- package/dist/generators/server/templates/src/main/java/_package_/config/SecurityConfiguration_reactive.java.ejs +2 -0
- package/dist/generators/server/templates/src/main/java/_package_/service/MailService.java.ejs +10 -4
- package/dist/generators/server/templates/src/main/java/_package_/web/rest/PublicUserResource.java.ejs +3 -4
- package/dist/generators/server/templates/src/main/java/_package_/web/rest/UserResource.java.ejs +0 -2
- package/dist/generators/server/templates/src/main/java/_package_/web/rest/errors/ExceptionTranslator.java.ejs +4 -7
- package/dist/generators/server/templates/src/test/java/_package_/_entityPackage_/web/rest/_entityClass_ResourceIT.java.ejs +3 -3
- package/dist/generators/server/templates/src/test/java/_package_/web/rest/AccountResourceIT.java.ejs +4 -4
- package/dist/generators/spring-data-elasticsearch/templates/src/main/java/_package_/_entityPackage_/repository/search/_entityClass_SearchRepository.java.ejs +0 -2
- package/dist/generators/spring-data-neo4j/templates/src/main/java/_package_/_entityPackage_/domain/_persistClass_.java.jhi.spring_data_neo4j.ejs +3 -37
- package/dist/generators/vue/generator.mjs +25 -16
- package/dist/generators/vue/resources/package.json +17 -16
- package/dist/generators/vue/templates/package.json.ejs +3 -5
- package/dist/generators/vue/templates/src/main/webapp/app/core/jhi-navbar/jhi-navbar.component.ts.ejs +10 -3
- package/dist/generators/vue/templates/src/main/webapp/app/core/jhi-navbar/jhi-navbar.vue.ejs +3 -4
- package/dist/generators/vue/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_.service.ts.ejs +1 -1
- package/dist/generators/vue/templates/src/main/webapp/app/entities/_entityFolder_/_entityFile_.vue.ejs +12 -0
- package/dist/generators/vue/templates/src/main/webapp/app/router/index.ts.ejs +8 -1
- package/dist/generators/vue/templates/webpack/webpack.microfrontend.js.jhi.vue.ejs +19 -34
- package/dist/jdl/converters/jdl-to-json/jdl-to-json-option-converter.js +2 -2
- package/dist/jdl/converters/jdl-to-json/jdl-to-json-relationship-converter.js +1 -1
- package/dist/jdl/converters/jdl-to-json/jdl-without-application-to-json-converter.js +1 -1
- package/dist/jdl/converters/parsed-jdl-to-jdl-object/application-converter.js +1 -17
- package/dist/jdl/exporters/applications/jhipster-application-formatter.js +17 -1
- package/dist/jdl/exporters/config.js +11 -0
- package/dist/jdl/exporters/export-utils.js +2 -13
- package/dist/jdl/index.js +1 -0
- package/dist/jdl/jdl-importer.js +6 -2
- package/dist/jdl/models/jdl-application-configuration-factory.js +34 -2
- package/dist/jdl/models/jdl-application-configuration.js +6 -3
- package/dist/jdl/models/jdl-application-factory.js +2 -2
- package/dist/jdl/models/jdl-application.js +12 -3
- package/dist/jdl/parsing/jdl-ast-builder-visitor.js +63 -7
- package/dist/jdl/parsing/jdl-parser.js +52 -6
- package/dist/jdl/parsing/lexer/application-tokens.js +1 -1
- package/dist/jdl/validators/entity-validator.js +4 -2
- package/dist/jdl/validators/enum-validator.js +4 -2
- package/dist/jdl/validators/jdl-with-application-validator.js +18 -8
- package/dist/jdl/validators/jdl-without-application-validator.js +30 -29
- package/dist/jdl/validators/validator.js +1 -1
- package/dist/types/generators/base/support/config.d.mts +3 -3
- package/dist/types/generators/base-application/support/prepare-entity.d.mts +6 -1
- package/dist/types/generators/bootstrap/support/auto-crlf-transform.d.mts +3 -2
- package/dist/types/generators/bootstrap/support/multi-step-transform/index.d.mts +3 -20
- package/dist/types/generators/bootstrap/support/multi-step-transform/template-file-fs.d.mts +15 -9
- package/dist/types/generators/bootstrap/support/multi-step-transform/template-file.d.mts +1 -0
- package/dist/types/generators/generator-constants.d.mts +3 -3
- package/dist/types/generators/java/support/package-info-transform.d.mts +1 -4
- package/dist/types/generators/server/support/templates/field-values.d.mts +1 -1
- package/dist/types/jdl/exporters/config.d.ts +1 -0
- package/dist/types/jdl/index.d.ts +1 -0
- package/dist/types/jdl/jdl-importer.d.ts +1 -0
- package/dist/types/jdl/models/jdl-application-configuration-factory.d.ts +1 -0
- package/dist/types/jdl/models/jdl-application-configuration-option.d.ts +2 -2
- package/dist/types/jdl/models/jdl-application-configuration.d.ts +8 -6
- package/dist/types/jdl/models/jdl-application-factory.d.ts +1 -1
- package/dist/types/jdl/models/jdl-application.d.ts +8 -4
- package/dist/types/jdl/models/jdl-object.d.ts +1 -1
- package/dist/types/jdl/models/list-jdl-application-configuration-option.d.ts +1 -1
- package/dist/types/jdl/parsing/jdl-ast-builder-visitor.d.ts +10 -0
- package/dist/types/jdl/parsing/jdl-parser.d.ts +3 -0
- package/dist/types/jdl/parsing/lexer/application-tokens.d.ts +1 -0
- package/dist/types/jdl/validators/entity-validator.d.ts +2 -2
- package/dist/types/jdl/validators/enum-validator.d.ts +2 -2
- package/dist/types/jdl/validators/validator.d.ts +4 -1
- package/package.json +31 -31
|
@@ -22,13 +22,6 @@ const { DefinePlugin } = require('webpack');
|
|
|
22
22
|
<%_ } _%>
|
|
23
23
|
<&_ } -&>
|
|
24
24
|
<&_ if (fragment.moduleFederationSection) { -&>
|
|
25
|
-
<%_ if (applicationTypeGateway) { _%>
|
|
26
|
-
remotes: {
|
|
27
|
-
<%_ for (const microfrontend of microfrontends) { _%>
|
|
28
|
-
'@<%= microfrontend.lowercaseBaseName %>': `<%= microfrontend.lowercaseBaseName %>@/<%= microfrontend.endpointPrefix %>/remoteEntry.js`,
|
|
29
|
-
<%_ } _%>
|
|
30
|
-
},
|
|
31
|
-
<%_ } _%>
|
|
32
25
|
<%_ if (applicationTypeMicroservice) { _%>
|
|
33
26
|
exposes: {
|
|
34
27
|
'./entities-menu': './<%= this.relativeDir(clientRootDir, clientSrcDir) %>app/entities/menu',
|
|
@@ -36,57 +29,19 @@ const { DefinePlugin } = require('webpack');
|
|
|
36
29
|
},
|
|
37
30
|
<%_ } _%>
|
|
38
31
|
shared: {
|
|
39
|
-
...
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
import: 'app/shared/error/error-boundary-routes',
|
|
53
|
-
requiredVersion: appVersion,
|
|
54
|
-
},
|
|
55
|
-
'app/shared/layout/menus/menu-components': {
|
|
56
|
-
singleton: true,
|
|
57
|
-
import: 'app/shared/layout/menus/menu-components',
|
|
58
|
-
requiredVersion: appVersion,
|
|
59
|
-
},
|
|
60
|
-
'app/shared/layout/menus/menu-item': {
|
|
61
|
-
singleton: true,
|
|
62
|
-
import: 'app/shared/layout/menus/menu-item',
|
|
63
|
-
requiredVersion: appVersion,
|
|
64
|
-
},
|
|
65
|
-
'app/shared/reducers': {
|
|
66
|
-
singleton: true,
|
|
67
|
-
import: 'app/shared/reducers',
|
|
68
|
-
requiredVersion: appVersion,
|
|
69
|
-
},
|
|
70
|
-
'app/shared/reducers/locale': {
|
|
71
|
-
singleton: true,
|
|
72
|
-
import: 'app/shared/reducers/locale',
|
|
73
|
-
requiredVersion: appVersion,
|
|
74
|
-
},
|
|
75
|
-
'app/shared/reducers/reducer.utils': {
|
|
76
|
-
singleton: true,
|
|
77
|
-
import: 'app/shared/reducers/reducer.utils',
|
|
78
|
-
requiredVersion: appVersion,
|
|
79
|
-
},
|
|
80
|
-
'app/shared/util/date-utils': {
|
|
81
|
-
singleton: true,
|
|
82
|
-
import: 'app/shared/util/date-utils',
|
|
83
|
-
requiredVersion: appVersion,
|
|
84
|
-
},
|
|
85
|
-
'app/shared/util/entity-utils': {
|
|
86
|
-
singleton: true,
|
|
87
|
-
import: 'app/shared/util/entity-utils',
|
|
88
|
-
requiredVersion: appVersion,
|
|
89
|
-
},
|
|
32
|
+
...shareDependencies(),
|
|
33
|
+
...shareMappings(
|
|
34
|
+
'app/config/constants',
|
|
35
|
+
'app/config/store',
|
|
36
|
+
'app/shared/error/error-boundary-routes',
|
|
37
|
+
'app/shared/layout/menus/menu-components',
|
|
38
|
+
'app/shared/layout/menus/menu-item',
|
|
39
|
+
'app/shared/reducers',
|
|
40
|
+
'app/shared/reducers/locale',
|
|
41
|
+
'app/shared/reducers/reducer.utils',
|
|
42
|
+
'app/shared/util/date-utils',
|
|
43
|
+
'app/shared/util/entity-utils',
|
|
44
|
+
),
|
|
90
45
|
},
|
|
91
46
|
<&_ } -&>
|
|
92
47
|
<&_ if (fragment.pluginsSection) { -&>
|
|
@@ -67,7 +67,7 @@ export default class JHipsterServerGenerator extends BaseApplicationGenerator {
|
|
|
67
67
|
projectVersion;
|
|
68
68
|
fakeKeytool;
|
|
69
69
|
command = command;
|
|
70
|
-
async beforeQueue(
|
|
70
|
+
async beforeQueue() {
|
|
71
71
|
if (!this.fromBlueprint) {
|
|
72
72
|
loadStoredAppOptions.call(this);
|
|
73
73
|
await this.composeWithBlueprints(GENERATOR_SERVER);
|
|
@@ -76,9 +76,6 @@ export default class JHipsterServerGenerator extends BaseApplicationGenerator {
|
|
|
76
76
|
await this.dependsOnJHipster(GENERATOR_BOOTSTRAP_APPLICATION);
|
|
77
77
|
await this.dependsOnJHipster(GENERATOR_COMMON);
|
|
78
78
|
await this.dependsOnJHipster(GENERATOR_JAVA);
|
|
79
|
-
if (useNpmWrapper) {
|
|
80
|
-
this.useNpmWrapperInstallTask();
|
|
81
|
-
}
|
|
82
79
|
}
|
|
83
80
|
}
|
|
84
81
|
get initializing() {
|
|
@@ -270,6 +267,18 @@ export default class JHipsterServerGenerator extends BaseApplicationGenerator {
|
|
|
270
267
|
get [BaseApplicationGenerator.PREPARING]() {
|
|
271
268
|
return this.asPreparingTaskGroup(this.delegateTasksToBlueprint(() => this.preparing));
|
|
272
269
|
}
|
|
270
|
+
get postPreparing() {
|
|
271
|
+
return this.asPostPreparingTaskGroup({
|
|
272
|
+
useNpmWrapper({ application }) {
|
|
273
|
+
if (application.useNpmWrapper) {
|
|
274
|
+
this.useNpmWrapperInstallTask();
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
get [BaseApplicationGenerator.POST_PREPARING]() {
|
|
280
|
+
return this.delegateTasksToBlueprint(() => this.postPreparing);
|
|
281
|
+
}
|
|
273
282
|
get configuringEachEntity() {
|
|
274
283
|
return this.asConfiguringEachEntityTaskGroup({
|
|
275
284
|
configureMicroservice({ application, entityConfig }) {
|
|
@@ -13,10 +13,10 @@ LABEL ALIAS=consul-config-loader
|
|
|
13
13
|
FROM postgres:16.0
|
|
14
14
|
LABEL ALIAS=postgresql
|
|
15
15
|
|
|
16
|
-
FROM quay.io/keycloak/keycloak:22.0.
|
|
16
|
+
FROM quay.io/keycloak/keycloak:22.0.5
|
|
17
17
|
LABEL ALIAS=keycloak
|
|
18
18
|
|
|
19
|
-
FROM mysql:8.
|
|
19
|
+
FROM mysql:8.2.0
|
|
20
20
|
|
|
21
21
|
FROM mariadb:11.1.2
|
|
22
22
|
|
|
@@ -31,14 +31,14 @@ FROM cassandra:3.11.14
|
|
|
31
31
|
FROM mcr.microsoft.com/mssql/server:2019-CU16-GDR1-ubuntu-20.04
|
|
32
32
|
LABEL ALIAS=mssql
|
|
33
33
|
|
|
34
|
-
FROM neo4j:5.
|
|
34
|
+
FROM neo4j:5.13.0
|
|
35
35
|
|
|
36
|
-
FROM hazelcast/management-center:5.3.
|
|
36
|
+
FROM hazelcast/management-center:5.3.3
|
|
37
37
|
LABEL ALIAS=hazelcast
|
|
38
38
|
|
|
39
|
-
FROM memcached:1.6.
|
|
39
|
+
FROM memcached:1.6.22-alpine
|
|
40
40
|
|
|
41
|
-
FROM redis:7.2.
|
|
41
|
+
FROM redis:7.2.2
|
|
42
42
|
|
|
43
43
|
FROM confluentinc/cp-kafka:7.5.1
|
|
44
44
|
LABEL ALIAS=kafka
|
|
@@ -64,7 +64,7 @@ LABEL ALIAS=prometheus-alertmanager
|
|
|
64
64
|
FROM quay.io/coreos/prometheus-operator:v0.42.1
|
|
65
65
|
LABEL ALIAS=prometheus-operator
|
|
66
66
|
|
|
67
|
-
FROM grafana/grafana:10.
|
|
67
|
+
FROM grafana/grafana:10.2.0
|
|
68
68
|
LABEL ALIAS=grafana
|
|
69
69
|
|
|
70
70
|
FROM quay.io/coreos/grafana-watcher:v0.0.8
|
|
@@ -13,6 +13,6 @@ gradle-modernizer-plugin = { id = 'com.github.andygoossens.gradle-modernizer-plu
|
|
|
13
13
|
|
|
14
14
|
gradle-enterprise = { id = 'com.gradle.enterprise', version = '3.15.1' }
|
|
15
15
|
|
|
16
|
-
common-custom-user-data-gradle-plugin = { id = 'com.gradle.common-custom-user-data-gradle-plugin', version = '1.
|
|
16
|
+
common-custom-user-data-gradle-plugin = { id = 'com.gradle.common-custom-user-data-gradle-plugin', version = '1.12' }
|
|
17
17
|
|
|
18
18
|
gatling-gradle = { id = 'io.gatling.gradle', version = '3.9.5.6' }
|
|
@@ -15,45 +15,45 @@
|
|
|
15
15
|
<gatling.version>3.9.5</gatling.version>
|
|
16
16
|
<h2.version>2.2.224</h2.version>
|
|
17
17
|
<hazelcast-hibernate53.version>5.1.0</hazelcast-hibernate53.version>
|
|
18
|
-
<hazelcast-spring.version>5.3.
|
|
18
|
+
<hazelcast-spring.version>5.3.5</hazelcast-spring.version>
|
|
19
19
|
<jackson-databind-nullable.version>0.2.6</jackson-databind-nullable.version>
|
|
20
|
-
<jaxb-runtime.version>4.0.
|
|
20
|
+
<jaxb-runtime.version>4.0.4</jaxb-runtime.version>
|
|
21
21
|
<junit-platform-launcher.version>1.10.0</junit-platform-launcher.version>
|
|
22
22
|
<liquibase.version>4.24.0</liquibase.version>
|
|
23
23
|
<mapstruct.version>1.5.5.Final</mapstruct.version>
|
|
24
24
|
<micrometer-context-propagation.version>1.0.6</micrometer-context-propagation.version>
|
|
25
25
|
<picocli.version>4.7.5</picocli.version>
|
|
26
26
|
<spring-pulsar.version>0.2.0</spring-pulsar.version>
|
|
27
|
-
<typesafe.version>1.4.
|
|
27
|
+
<typesafe.version>1.4.3</typesafe.version>
|
|
28
28
|
<validation-api.version>3.0.2</validation-api.version>
|
|
29
29
|
|
|
30
30
|
<!-- Plugin versions -->
|
|
31
31
|
<checkstyle.version>10.12.4</checkstyle.version>
|
|
32
32
|
<checksum-maven-plugin.version>1.11</checksum-maven-plugin.version>
|
|
33
|
-
<frontend-maven-plugin.version>1.14.
|
|
33
|
+
<frontend-maven-plugin.version>1.14.2</frontend-maven-plugin.version>
|
|
34
34
|
<gatling-maven-plugin.version>4.6.0</gatling-maven-plugin.version>
|
|
35
|
-
<git-commit-id-maven-plugin.version>
|
|
35
|
+
<git-commit-id-maven-plugin.version>7.0.0</git-commit-id-maven-plugin.version>
|
|
36
36
|
<jib-maven-plugin.version>3.4.0</jib-maven-plugin.version>
|
|
37
37
|
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
|
|
38
|
-
<jacoco-maven-plugin.version>0.8.
|
|
38
|
+
<jacoco-maven-plugin.version>0.8.11</jacoco-maven-plugin.version>
|
|
39
39
|
<maven-antrun-plugin.version>3.1.0</maven-antrun-plugin.version>
|
|
40
|
-
<maven-checkstyle-plugin.version>3.3.
|
|
41
|
-
<maven-clean-plugin.version>3.3.
|
|
40
|
+
<maven-checkstyle-plugin.version>3.3.1</maven-checkstyle-plugin.version>
|
|
41
|
+
<maven-clean-plugin.version>3.3.2</maven-clean-plugin.version>
|
|
42
42
|
<maven-compiler-plugin.version>3.11.0</maven-compiler-plugin.version>
|
|
43
43
|
<maven-eclipse-plugin.version>2.10</maven-eclipse-plugin.version>
|
|
44
44
|
<maven-enforcer-plugin.version>3.4.1</maven-enforcer-plugin.version>
|
|
45
|
-
<maven-failsafe-plugin.version>3.1
|
|
45
|
+
<maven-failsafe-plugin.version>3.2.1</maven-failsafe-plugin.version>
|
|
46
46
|
<maven-idea-plugin.version>2.2.1</maven-idea-plugin.version>
|
|
47
47
|
<maven-jar-plugin.version>3.3.0</maven-jar-plugin.version>
|
|
48
48
|
<maven-javadoc-plugin.version>3.6.0</maven-javadoc-plugin.version>
|
|
49
49
|
<maven-resources-plugin.version>3.3.1</maven-resources-plugin.version>
|
|
50
50
|
<maven-site-plugin.version>3.12.1</maven-site-plugin.version>
|
|
51
|
-
<maven-surefire-plugin.version>3.1
|
|
51
|
+
<maven-surefire-plugin.version>3.2.1</maven-surefire-plugin.version>
|
|
52
52
|
<maven-war-plugin.version>3.4.0</maven-war-plugin.version>
|
|
53
53
|
<modernizer-maven-plugin.version>2.7.0</modernizer-maven-plugin.version>
|
|
54
54
|
<nohttp-checkstyle.version>0.0.11</nohttp-checkstyle.version>
|
|
55
55
|
<openapi-generator-maven-plugin.version>7.0.1</openapi-generator-maven-plugin.version>
|
|
56
|
-
<properties-maven-plugin.version>1.2.
|
|
56
|
+
<properties-maven-plugin.version>1.2.1</properties-maven-plugin.version>
|
|
57
57
|
<sonar-maven-plugin.version>3.10.0.2594</sonar-maven-plugin.version>
|
|
58
58
|
<spotless-maven-plugin.version>2.40.0</spotless-maven-plugin.version>
|
|
59
59
|
</properties>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mutateData, normalizePathEnd, pickFields } from '../../base/support/index.mjs';
|
|
2
2
|
import { databaseTypes, monitoringTypes, authenticationTypes, buildToolTypes, cacheTypes, websocketTypes, serviceDiscoveryTypes, searchEngineTypes, } from '../../../jdl/jhipster/index.mjs';
|
|
3
3
|
import { prepareSqlApplicationProperties } from '../../spring-data-relational/support/index.mjs';
|
|
4
4
|
import { CLIENT_DIST_DIR, CLIENT_MAIN_SRC_DIR, CLIENT_TEST_SRC_DIR, SERVER_MAIN_RES_DIR, SERVER_MAIN_SRC_DIR, SERVER_TEST_RES_DIR, SERVER_TEST_SRC_DIR, } from '../../generator-constants.mjs';
|
|
@@ -21,7 +21,7 @@ const NO_SEARCH_ENGINE = searchEngineTypes.NO;
|
|
|
21
21
|
* all variables should be referred from config,
|
|
22
22
|
*/
|
|
23
23
|
export const loadServerConfig = ({ config, application }) => {
|
|
24
|
-
|
|
24
|
+
mutateData(application, {
|
|
25
25
|
srcMainJava: SERVER_MAIN_SRC_DIR,
|
|
26
26
|
srcMainResources: SERVER_MAIN_RES_DIR,
|
|
27
27
|
srcMainWebapp: CLIENT_MAIN_SRC_DIR,
|
|
@@ -59,7 +59,7 @@ export const loadServerConfig = ({ config, application }) => {
|
|
|
59
59
|
* @param {import('./base-application/types.js').PlatformApplication} dest - destination context to use default is context
|
|
60
60
|
*/
|
|
61
61
|
export const loadPlatformConfig = ({ config, application }) => {
|
|
62
|
-
|
|
62
|
+
mutateData(application, pickFields(config, ['serviceDiscoveryType', 'monitoring']));
|
|
63
63
|
};
|
|
64
64
|
export const loadDerivedServerAndPlatformProperties = ({ application }) => {
|
|
65
65
|
if (!application.serviceDiscoveryType) {
|
|
@@ -121,7 +121,7 @@ export const loadDerivedServerConfig = ({ application }) => {
|
|
|
121
121
|
application.databaseMigrationLiquibase = application.databaseMigration
|
|
122
122
|
? application.databaseMigration === 'liquibase'
|
|
123
123
|
: application.databaseType === SQL;
|
|
124
|
-
|
|
124
|
+
mutateData(application, {
|
|
125
125
|
packageFolder: ({ packageName }) => `${packageName.replace(/\./g, '/')}/`,
|
|
126
126
|
javaPackageSrcDir: ({ srcMainJava, packageFolder }) => normalizePathEnd(`${srcMainJava}${packageFolder}`),
|
|
127
127
|
javaPackageTestDir: ({ srcTestJava, packageFolder }) => normalizePathEnd(`${srcTestJava}${packageFolder}`),
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import path from 'path';
|
|
20
20
|
import { databaseTypes, searchEngineTypes } from '../../../jdl/jhipster/index.mjs';
|
|
21
21
|
import { isReservedTableName } from '../../../jdl/jhipster/reserved-keywords.js';
|
|
22
|
-
import { normalizePathEnd } from '../../base/support/index.mjs';
|
|
22
|
+
import { mutateData, normalizePathEnd } from '../../base/support/index.mjs';
|
|
23
23
|
import { hibernateSnakeCase } from './string.mjs';
|
|
24
24
|
import { getDatabaseTypeData } from './database.mjs';
|
|
25
25
|
import { formatDocAsApiDescription, formatDocAsJavaDoc } from './doc.mjs';
|
|
@@ -39,10 +39,10 @@ export default function prepareEntity(entity) {
|
|
|
39
39
|
entity.entityAbsolutePackage = entityAbsolutePackage;
|
|
40
40
|
entity.entityAbsoluteFolder = entityAbsoluteFolder;
|
|
41
41
|
entity.entityAbsoluteClass = `${entityAbsolutePackage}.domain.${persistClass}`;
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}
|
|
42
|
+
mutateData(entity, {
|
|
43
|
+
entityJavadoc: ({ documentation }) => (documentation ? formatDocAsJavaDoc(documentation) : documentation),
|
|
44
|
+
entityApiDescription: ({ documentation }) => (documentation ? formatDocAsApiDescription(documentation) : documentation),
|
|
45
|
+
});
|
|
46
46
|
if (isReservedTableName(entity.entityInstance, entity.prodDatabaseType ?? entity.databaseType) && entity.jhiPrefix) {
|
|
47
47
|
entity.entityInstanceDbSafe = `${entity.jhiPrefix}${entity.entityClass}`;
|
|
48
48
|
}
|
|
@@ -21,6 +21,7 @@ import * as _ from 'lodash-es';
|
|
|
21
21
|
import { databaseTypes, entityOptions, fieldTypes, reservedKeywords } from '../../../jdl/jhipster/index.mjs';
|
|
22
22
|
import { getUXConstraintName } from './database.mjs';
|
|
23
23
|
import { hibernateSnakeCase } from './string.mjs';
|
|
24
|
+
import { getJavaValueGeneratorForType } from './templates/field-values.mjs';
|
|
24
25
|
import { formatDocAsApiDescription, formatDocAsJavaDoc } from './doc.mjs';
|
|
25
26
|
const TYPE_BYTES = fieldTypes.RelationalOnlyDBTypes.BYTES;
|
|
26
27
|
const TYPE_BYTE_BUFFER = fieldTypes.RelationalOnlyDBTypes.BYTE_BUFFER;
|
|
@@ -139,5 +140,24 @@ export default function prepareField(entityWithConfig, field, generator) {
|
|
|
139
140
|
else {
|
|
140
141
|
field.javaFieldType = field.fieldType;
|
|
141
142
|
}
|
|
143
|
+
if (field.fieldTypeInteger || field.fieldTypeLong || field.fieldTypeString || field.fieldTypeUUID) {
|
|
144
|
+
if (field.fieldTypeInteger) {
|
|
145
|
+
field.javaValueSample1 = '1';
|
|
146
|
+
field.javaValueSample2 = '2';
|
|
147
|
+
}
|
|
148
|
+
else if (field.fieldTypeLong) {
|
|
149
|
+
field.javaValueSample1 = '1L';
|
|
150
|
+
field.javaValueSample2 = '2L';
|
|
151
|
+
}
|
|
152
|
+
else if (field.fieldTypeString) {
|
|
153
|
+
field.javaValueSample1 = `"${field.fieldName}1"`;
|
|
154
|
+
field.javaValueSample2 = `"${field.fieldName}2"`;
|
|
155
|
+
}
|
|
156
|
+
else if (field.fieldTypeUUID) {
|
|
157
|
+
field.javaValueSample1 = 'UUID.fromString("23d8dc04-a48b-45d9-a01d-4b728f0ad4aa")';
|
|
158
|
+
field.javaValueSample2 = 'UUID.fromString("ad79f240-3727-46c3-b89f-2cf6ebd74367")';
|
|
159
|
+
}
|
|
160
|
+
field.javaValueGenerator = getJavaValueGeneratorForType(field.javaFieldType);
|
|
161
|
+
}
|
|
142
162
|
field.filterableField = ![TYPE_BYTES, TYPE_BYTE_BUFFER].includes(field.fieldType);
|
|
143
163
|
}
|
|
@@ -23,7 +23,8 @@ export const addEntitiesOtherRelationships = (entities) => {
|
|
|
23
23
|
for (const entity of entities) {
|
|
24
24
|
for (const relationship of entity.relationships ?? []) {
|
|
25
25
|
if (!relationship.otherRelationship &&
|
|
26
|
-
(relationship.
|
|
26
|
+
(relationship.otherEntityRelationshipName ||
|
|
27
|
+
relationship.relationshipType === 'many-to-many' ||
|
|
27
28
|
// OneToOne back reference is required due to filtering
|
|
28
29
|
(relationship.relationshipType === 'one-to-one' && entity.databaseType === 'sql') ||
|
|
29
30
|
(relationship.relationshipType === 'one-to-many' && entity.databaseType !== 'neo4j' && entity.databaseType !== 'no'))) {
|
|
@@ -31,8 +31,11 @@ export const getJavaValueGeneratorForType = (type) => {
|
|
|
31
31
|
if (type === UUID) {
|
|
32
32
|
return 'UUID.randomUUID()';
|
|
33
33
|
}
|
|
34
|
-
if (type ===
|
|
35
|
-
return '
|
|
34
|
+
if (type === INTEGER) {
|
|
35
|
+
return 'intCount.incrementAndGet()';
|
|
36
|
+
}
|
|
37
|
+
if (type === LONG) {
|
|
38
|
+
return 'longCount.incrementAndGet()';
|
|
36
39
|
}
|
|
37
40
|
throw new Error(`Java type ${type} does not have a random generator implemented`);
|
|
38
41
|
};
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
EJS fragments will process % delimiter tags in template and & delimiter tags in the merge process.
|
|
22
22
|
-%>
|
|
23
23
|
<&_ if (fragment.introSection) { -&>
|
|
24
|
-
This application was generated using JHipster <%= jhipsterVersion %>, you can find documentation and help at [<%= documentationArchiveUrl %>](<%= documentationArchiveUrl %>).
|
|
25
24
|
<%_ if (applicationTypeGateway || applicationTypeMicroservice) { _%>
|
|
26
25
|
|
|
27
26
|
This is a "<%= applicationType %>" application intended to be part of a microservice architecture, please refer to the [Doing microservices with JHipster][] page of the documentation for more information.
|
|
@@ -25,11 +25,6 @@
|
|
|
25
25
|
"cacheDirectories": [
|
|
26
26
|
"node_modules"
|
|
27
27
|
],
|
|
28
|
-
"devDependencies": {
|
|
29
|
-
"prettier": "<%= nodeDependencies.prettier %>",
|
|
30
|
-
"prettier-plugin-java": "<%= nodeDependencies['prettier-plugin-java'] %>",
|
|
31
|
-
"prettier-plugin-packagejson": "<%= nodeDependencies['prettier-plugin-packagejson'] %>"
|
|
32
|
-
},
|
|
33
28
|
"engines": {
|
|
34
29
|
"node": ">=<%= nodeVersion %>"
|
|
35
30
|
},
|
|
@@ -758,7 +758,7 @@
|
|
|
758
758
|
<version>${maven-resources-plugin.version}</version>
|
|
759
759
|
<executions>
|
|
760
760
|
<execution>
|
|
761
|
-
<id>
|
|
761
|
+
<id>config-resources</id>
|
|
762
762
|
<phase>validate</phase>
|
|
763
763
|
<goals>
|
|
764
764
|
<goal>copy-resources</goal>
|
|
@@ -777,13 +777,6 @@
|
|
|
777
777
|
<include>config/*.yml</include>
|
|
778
778
|
</includes>
|
|
779
779
|
</resource>
|
|
780
|
-
<resource>
|
|
781
|
-
<directory><%= SERVER_MAIN_RES_DIR %></directory>
|
|
782
|
-
<filtering>false</filtering>
|
|
783
|
-
<excludes>
|
|
784
|
-
<exclude>config/*.yml</exclude>
|
|
785
|
-
</excludes>
|
|
786
|
-
</resource>
|
|
787
780
|
</resources>
|
|
788
781
|
</configuration>
|
|
789
782
|
</execution>
|
|
@@ -62,7 +62,7 @@ _%>
|
|
|
62
62
|
* @param criteria the criteria which the requested entities should match.
|
|
63
63
|
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the count in body.
|
|
64
64
|
*/
|
|
65
|
-
@GetMapping("
|
|
65
|
+
@GetMapping("/count")
|
|
66
66
|
public <% if (reactive) { %>Mono<<% } %>ResponseEntity<Long><% if (reactive) { %>><% } %> count<%= entityClassPlural %>(<%= entityClass %>Criteria criteria) {
|
|
67
67
|
<% if (!reactive) { %>
|
|
68
68
|
log.debug("REST request to count <%= entityClassPlural %> by criteria: {}", criteria);
|
|
@@ -75,7 +75,7 @@ _%>
|
|
|
75
75
|
}
|
|
76
76
|
<%_ } else { _%>
|
|
77
77
|
<%_ if (paginationNo) { _%>
|
|
78
|
-
public <% if (reactive) { %>Mono<<% } %>List<<%= instanceType %>><% if (reactive) { %>><% } %> getAll<%= entityClassPlural %>(<% if (fieldsContainNoOwnerOneToOne) { %>@RequestParam(required = false) String filter<% } %><% if (implementsEagerLoadApis && fieldsContainNoOwnerOneToOne) { %>,<% } %><% if (implementsEagerLoadApis) { %>@RequestParam(required = false, defaultValue = "
|
|
78
|
+
public <% if (reactive) { %>Mono<<% } %>List<<%= instanceType %>><% if (reactive) { %>><% } %> getAll<%= entityClassPlural %>(<% if (fieldsContainNoOwnerOneToOne) { %>@RequestParam(required = false) String filter<% } %><% if (implementsEagerLoadApis && fieldsContainNoOwnerOneToOne) { %>,<% } %><% if (implementsEagerLoadApis) { %>@RequestParam(required = false, defaultValue = "true") boolean eagerload<% } %>) {<%- include('get_all_stream_template', {viaService: viaService}); -%>
|
|
79
79
|
log.debug("REST request to get all <%= entityClassPlural %>");
|
|
80
80
|
<%_ if (viaService) { _%>
|
|
81
81
|
return <%= entityInstance %>Service.findAll()<% if (reactive) { %>.collectList()<% } %>;
|
|
@@ -96,7 +96,7 @@ _%>
|
|
|
96
96
|
return <%= entityInstance %>Repository.findAll()<% if (reactive) { %>.collectList()<% } %>;
|
|
97
97
|
<%_ } _%>
|
|
98
98
|
<%_ } else { _%>
|
|
99
|
-
public <% if (reactive) { %>Mono<ResponseEntity<List<<%= instanceType %>>>><% } else { %>ResponseEntity<List<<%= instanceType %>>><% } %> getAll<%= entityClassPlural %>(@org.springdoc.core.annotations.ParameterObject Pageable pageable<% if (reactive) { %>, ServerHttpRequest request<% } %><% if (fieldsContainNoOwnerOneToOne) { %>, @RequestParam(required = false) String filter<% } %><% if (implementsEagerLoadApis) { %>, @RequestParam(required = false, defaultValue = "
|
|
99
|
+
public <% if (reactive) { %>Mono<ResponseEntity<List<<%= instanceType %>>>><% } else { %>ResponseEntity<List<<%= instanceType %>>><% } %> getAll<%= entityClassPlural %>(@org.springdoc.core.annotations.ParameterObject Pageable pageable<% if (reactive) { %>, ServerHttpRequest request<% } %><% if (fieldsContainNoOwnerOneToOne) { %>, @RequestParam(required = false) String filter<% } %><% if (implementsEagerLoadApis) { %>, @RequestParam(required = false, defaultValue = "true") boolean eagerload<% } %>) {<%- include('get_all_stream_template', {viaService: viaService}); -%>
|
|
100
100
|
log.debug("REST request to get a page of <%= entityClassPlural %>");
|
|
101
101
|
<%_ if (reactive) { _%>
|
|
102
102
|
return <%= entityInstance %><%= viaService ? 'Service.countAll' : 'Repository.count' %>().zipWith(<%= entityInstance %><%= viaService ? 'Service.findAll' : 'Repository.findAllBy' %>(pageable)<%= reactiveEntityToDto %>.collectList())
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
package <%= entityAbsolutePackage %>.service.dto;
|
|
20
20
|
|
|
21
21
|
import java.util.Objects;
|
|
22
|
-
<%_ if (
|
|
22
|
+
<%_ if (entityApiDescription || importApiModelProperty) { _%>
|
|
23
23
|
import io.swagger.v3.oas.annotations.media.Schema;
|
|
24
24
|
<%_ } _%>
|
|
25
25
|
<%_ if (anyFieldIsInstant) { _%>
|
|
@@ -65,7 +65,7 @@ import <%= `${otherEntity.entityAbsolutePackage}.service.dto.${otherEntity.dtoCl
|
|
|
65
65
|
/**
|
|
66
66
|
* A DTO for the {@link <%= entityAbsolutePackage %>.domain.<%= persistClass %>} entity.
|
|
67
67
|
*/
|
|
68
|
-
<%_ if (
|
|
68
|
+
<%_ if (entityApiDescription) { _%>
|
|
69
69
|
@Schema(description = "<%- entityApiDescription %>")
|
|
70
70
|
<%_ } _%>
|
|
71
71
|
@SuppressWarnings("common-java:DuplicatedBlocks")
|
|
@@ -130,7 +130,7 @@ import java.util.stream.StreamSupport;
|
|
|
130
130
|
* REST controller for managing {@link <%= entityAbsoluteClass %>}.
|
|
131
131
|
*/
|
|
132
132
|
@RestController
|
|
133
|
-
@RequestMapping("/api")
|
|
133
|
+
@RequestMapping("/api/<%= entityApiUrl %>")
|
|
134
134
|
<%_ if (databaseTypeSql && !viaService && !saveUserSnapshot) { _%>
|
|
135
135
|
@Transactional
|
|
136
136
|
<%_ } _%>
|
|
@@ -163,7 +163,7 @@ public class <%= entityClass %>Resource {
|
|
|
163
163
|
* @return the {@link ResponseEntity} with status {@code 201 (Created)} and with body the new <%= instanceName %>, or with status {@code 400 (Bad Request)} if the <%= entityInstance %> has already an ID.
|
|
164
164
|
* @throws URISyntaxException if the Location URI syntax is incorrect.
|
|
165
165
|
*/
|
|
166
|
-
@PostMapping("
|
|
166
|
+
@PostMapping("")
|
|
167
167
|
public <% if (reactive) { %>Mono<<% } %>ResponseEntity<<%= instanceType %>><% if (reactive) { %>><% } %> create<%= entityClass %>(<% if (anyPropertyHasValidation) { %>@Valid <% } %>@RequestBody <%= instanceType %> <%= instanceName %>) throws URISyntaxException {
|
|
168
168
|
log.debug("REST request to save <%= entityClass %> : {}", <%= instanceName %>);
|
|
169
169
|
if (<%= instanceName %>.get<%= primaryKey.nameCapitalized %>() != null) {
|
|
@@ -217,7 +217,7 @@ public class <%= entityClass %>Resource {
|
|
|
217
217
|
* or with status {@code 500 (Internal Server Error)} if the <%= instanceName %> couldn't be updated.
|
|
218
218
|
* @throws URISyntaxException if the Location URI syntax is incorrect.
|
|
219
219
|
*/
|
|
220
|
-
@PutMapping("
|
|
220
|
+
@PutMapping("/{<%= primaryKey.name %>}")
|
|
221
221
|
public <% if (reactive) { %>Mono<<% } %>ResponseEntity<<%= instanceType %>><% if (reactive) { %>><% } %> update<%= entityClass %>(
|
|
222
222
|
@PathVariable(value = "<%= primaryKey.name %>", required = false) final <%= primaryKey.type %> <%= primaryKey.name %>,
|
|
223
223
|
<% if (anyPropertyHasValidation) { %>@Valid <% } %>@RequestBody <%= instanceType %> <%= instanceName %>
|
|
@@ -283,7 +283,7 @@ public class <%= entityClass %>Resource {
|
|
|
283
283
|
* or with status {@code 500 (Internal Server Error)} if the <%= instanceName %> couldn't be updated.
|
|
284
284
|
* @throws URISyntaxException if the Location URI syntax is incorrect.
|
|
285
285
|
*/
|
|
286
|
-
@PatchMapping(value = "
|
|
286
|
+
@PatchMapping(value = "/{<%= primaryKey.name %>}", consumes = {"application/json", "application/merge-patch+json"})
|
|
287
287
|
public <% if (reactive) { %>Mono<<% } %>ResponseEntity<<%= instanceType %>><% if (reactive) { %>><% } %> partialUpdate<%= entityClass %>(
|
|
288
288
|
@PathVariable(value = "<%= primaryKey.name %>", required = false) final <%= primaryKey.type %> <%= primaryKey.name %>,
|
|
289
289
|
<% if (anyPropertyHasValidation) { %>@NotNull <% } %>@RequestBody <%= instanceType %> <%= instanceName %>) throws URISyntaxException {
|
|
@@ -360,9 +360,9 @@ public class <%= entityClass %>Resource {
|
|
|
360
360
|
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and the list of <%= entityInstancePlural %> in body.
|
|
361
361
|
*/
|
|
362
362
|
<%_ if (reactive) { _%>
|
|
363
|
-
@GetMapping(value = "
|
|
363
|
+
@GetMapping(value = "", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
364
364
|
<%_ } else { _%>
|
|
365
|
-
@GetMapping("
|
|
365
|
+
@GetMapping("")
|
|
366
366
|
<%_ } _%>
|
|
367
367
|
<%_ if (databaseTypeSql && isUsingMapsId && !viaService) { _%>
|
|
368
368
|
@Transactional(readOnly = true)
|
|
@@ -374,7 +374,7 @@ public class <%= entityClass %>Resource {
|
|
|
374
374
|
* {@code GET /<%= entityApiUrl %>} : get all the <%= entityInstancePlural %> as a stream.
|
|
375
375
|
* @return the {@link Flux} of <%= entityInstancePlural %>.
|
|
376
376
|
*/
|
|
377
|
-
@GetMapping(value = "
|
|
377
|
+
@GetMapping(value = "", produces = MediaType.APPLICATION_NDJSON_VALUE)
|
|
378
378
|
<%_ if (databaseTypeSql && isUsingMapsId && !viaService) { _%>
|
|
379
379
|
@Transactional(readOnly = true)
|
|
380
380
|
<%_ } _%>
|
|
@@ -394,7 +394,7 @@ public class <%= entityClass %>Resource {
|
|
|
394
394
|
* @param id the id of the <%= instanceName %> to retrieve.
|
|
395
395
|
* @return the {@link ResponseEntity} with status {@code 200 (OK)} and with body the <%= instanceName %>, or with status {@code 404 (Not Found)}.
|
|
396
396
|
*/
|
|
397
|
-
@GetMapping("
|
|
397
|
+
@GetMapping("/{id}")
|
|
398
398
|
<%_ if (databaseTypeSql && isUsingMapsId && !viaService) { _%>
|
|
399
399
|
@Transactional(readOnly = true)
|
|
400
400
|
<%_ } _%>
|
|
@@ -410,7 +410,7 @@ public class <%= entityClass %>Resource {
|
|
|
410
410
|
* @param id the id of the <%= instanceName %> to delete.
|
|
411
411
|
* @return the {@link ResponseEntity} with status {@code 204 (NO_CONTENT)}.
|
|
412
412
|
*/
|
|
413
|
-
@DeleteMapping("
|
|
413
|
+
@DeleteMapping("/{id}")
|
|
414
414
|
public <% if (reactive) { %>Mono<<% } %>ResponseEntity<Void><% if (reactive) { %>><% } %> delete<%= entityClass %>(@PathVariable <%= primaryKey.type %> id) {
|
|
415
415
|
log.debug("REST request to delete <%= entityClass %> : {}", id);
|
|
416
416
|
<%- include('../../_partials_entity_/delete_template', {viaService: viaService, fromResource: true}); -%>
|
|
@@ -432,7 +432,7 @@ public class <%= entityClass %>Resource {
|
|
|
432
432
|
<%_ if (searchEngineAny) { _%>
|
|
433
433
|
|
|
434
434
|
/**
|
|
435
|
-
* {@code SEARCH
|
|
435
|
+
* {@code SEARCH /<%= entityApiUrl %>/_search?query=:query} : search for the <%= entityInstance %> corresponding
|
|
436
436
|
* to the query.
|
|
437
437
|
*
|
|
438
438
|
* @param query the query of the <%= entityInstance %> search.
|
|
@@ -444,6 +444,6 @@ public class <%= entityClass %>Resource {
|
|
|
444
444
|
<%_ } _%>
|
|
445
445
|
* @return the result of the search.
|
|
446
446
|
*/
|
|
447
|
-
@GetMapping("/_search
|
|
447
|
+
@GetMapping("/_search")<%- include('../../_partials_entity_/search_template', {viaService}); -%>
|
|
448
448
|
<%_ } _%>
|
|
449
449
|
}
|
|
@@ -20,6 +20,7 @@ package <%= packageName %>.config;
|
|
|
20
20
|
|
|
21
21
|
<%_ if (databaseTypeSql && !reactive) { _%>
|
|
22
22
|
import com.fasterxml.jackson.datatype.hibernate6.Hibernate6Module;
|
|
23
|
+
import com.fasterxml.jackson.datatype.hibernate6.Hibernate6Module.Feature;
|
|
23
24
|
<%_ } _%>
|
|
24
25
|
import com.fasterxml.jackson.datatype.jdk8.Jdk8Module;
|
|
25
26
|
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
|
|
@@ -50,7 +51,7 @@ public class JacksonConfiguration {
|
|
|
50
51
|
*/
|
|
51
52
|
@Bean
|
|
52
53
|
public Hibernate6Module hibernate6Module() {
|
|
53
|
-
return new Hibernate6Module();
|
|
54
|
+
return new Hibernate6Module().configure(Feature.SERIALIZE_IDENTIFIER_FOR_LAZY_NOT_LOADED_OBJECTS, true);
|
|
54
55
|
}
|
|
55
56
|
<%_ } _%>
|
|
56
57
|
}
|
|
@@ -182,7 +182,7 @@ public class SecurityConfiguration {
|
|
|
182
182
|
// prettier-ignore
|
|
183
183
|
authz
|
|
184
184
|
<%_ if (!skipClient) { _%>
|
|
185
|
-
.requestMatchers(mvc.pattern("/index.html"), mvc.pattern("/*.js"), mvc.pattern("/*.map"), mvc.pattern("/*.css")).permitAll()
|
|
185
|
+
.requestMatchers(mvc.pattern("/index.html"), mvc.pattern("/*.js"), mvc.pattern("/*.txt"), mvc.pattern("/*.json"), mvc.pattern("/*.map"), mvc.pattern("/*.css")).permitAll()
|
|
186
186
|
.requestMatchers(mvc.pattern("/*.ico"), mvc.pattern("/*.png"), mvc.pattern("/*.svg"), mvc.pattern("/*.webapp")).permitAll()
|
|
187
187
|
<%_ if (clientFrameworkVue) { _%>
|
|
188
188
|
.requestMatchers(mvc.pattern("/assets/**")).permitAll()
|
|
@@ -285,6 +285,8 @@ public class SecurityConfiguration {
|
|
|
285
285
|
<%_ if (microfrontend) { _%>
|
|
286
286
|
// microfrontend resources are loaded by webpack without authentication, they need to be public
|
|
287
287
|
.pathMatchers("/services/*/*.js").permitAll()
|
|
288
|
+
.pathMatchers("/services/*/*.txt").permitAll()
|
|
289
|
+
.pathMatchers("/services/*/*.json").permitAll()
|
|
288
290
|
.pathMatchers("/services/*/*.js.map").permitAll()
|
|
289
291
|
<%_ } _%>
|
|
290
292
|
.pathMatchers("/services/*/management/health/readiness").permitAll()
|
package/dist/generators/server/templates/src/main/java/_package_/service/MailService.java.ejs
CHANGED
|
@@ -29,7 +29,9 @@ import jakarta.mail.internet.MimeMessage;
|
|
|
29
29
|
|
|
30
30
|
import org.slf4j.Logger;
|
|
31
31
|
import org.slf4j.LoggerFactory;
|
|
32
|
+
import org.springframework.beans.factory.annotation.Autowired;
|
|
32
33
|
import org.springframework.context.MessageSource;
|
|
34
|
+
import org.springframework.context.annotation.Lazy;
|
|
33
35
|
import org.springframework.mail.MailException;
|
|
34
36
|
import org.springframework.mail.javamail.JavaMailSender;
|
|
35
37
|
import org.springframework.mail.javamail.MimeMessageHelper;
|
|
@@ -60,6 +62,10 @@ public class MailService {
|
|
|
60
62
|
|
|
61
63
|
private final SpringTemplateEngine templateEngine;
|
|
62
64
|
|
|
65
|
+
@Autowired
|
|
66
|
+
@Lazy
|
|
67
|
+
private MailService self;
|
|
68
|
+
|
|
63
69
|
public MailService(JHipsterProperties jHipsterProperties, JavaMailSender javaMailSender,
|
|
64
70
|
MessageSource messageSource, SpringTemplateEngine templateEngine) {
|
|
65
71
|
|
|
@@ -101,26 +107,26 @@ public class MailService {
|
|
|
101
107
|
context.setVariable(BASE_URL, jHipsterProperties.getMail().getBaseUrl());
|
|
102
108
|
String content = templateEngine.process(templateName, context);
|
|
103
109
|
String subject = messageSource.getMessage(titleKey, null, locale);
|
|
104
|
-
sendEmail(user.getEmail(), subject, content, false, true);
|
|
110
|
+
self.sendEmail(user.getEmail(), subject, content, false, true);
|
|
105
111
|
}
|
|
106
112
|
<%_ if (!authenticationTypeOauth2) { _%>
|
|
107
113
|
|
|
108
114
|
@Async
|
|
109
115
|
public void sendActivationEmail(<%= user.persistClass %> user) {
|
|
110
116
|
log.debug("Sending activation email to '{}'", user.getEmail());
|
|
111
|
-
sendEmailFromTemplate(user, "mail/activationEmail", "email.activation.title");
|
|
117
|
+
self.sendEmailFromTemplate(user, "mail/activationEmail", "email.activation.title");
|
|
112
118
|
}
|
|
113
119
|
|
|
114
120
|
@Async
|
|
115
121
|
public void sendCreationEmail(<%= user.persistClass %> user) {
|
|
116
122
|
log.debug("Sending creation email to '{}'", user.getEmail());
|
|
117
|
-
sendEmailFromTemplate(user, "mail/creationEmail", "email.activation.title");
|
|
123
|
+
self.sendEmailFromTemplate(user, "mail/creationEmail", "email.activation.title");
|
|
118
124
|
}
|
|
119
125
|
|
|
120
126
|
@Async
|
|
121
127
|
public void sendPasswordResetMail(<%= user.persistClass %> user) {
|
|
122
128
|
log.debug("Sending password reset email to '{}'", user.getEmail());
|
|
123
|
-
sendEmailFromTemplate(user, "mail/passwordResetEmail", "email.reset.title");
|
|
129
|
+
self.sendEmailFromTemplate(user, "mail/passwordResetEmail", "email.reset.title");
|
|
124
130
|
}
|
|
125
131
|
<%_ } _%>
|
|
126
132
|
}
|