Closed leottamichel closed 9 months ago
I tried creating a new project with JHipster 7.8.1 using your .yo-rc.json
. This works. However, when I tried to import your JDL with jhipster jdl entities.jdl
, it fails with the following error:
create src/main/java/com/swaps/gateway/web/rest/PlanedPrioResource.java
create src/main/java/com/swaps/gateway/repository/PlanedPrioRepository.java
Error running generator entities: Error: Error parsing file src/main/java/com/swaps/gateway/repository/PlanedPrioRepositoryInternalImpl.java: undefined
At: 1: package com.swaps.gateway.repository;
2:
3: import java.util.function.BiFunction;
4: import java.util.ArrayList;
5: import java.util.List;
6: import java.util.Map;
7: import java.util.Map.Entry;
8: import java.util.Optional;
9: import org.springframework.data.domain.Pageable;
10: import io.r2dbc.spi.Row;
11: import io.r2dbc.spi.RowMetadata;
12: import static org.springframework.data.relational.core.query.Criteria.where;
13: import org.springframework.data.r2dbc.convert.R2dbcConverter;
14: import org.springframework.data.r2dbc.core.R2dbcEntityOperations;
15: import org.springframework.data.r2dbc.core.R2dbcEntityTemplate;
16: import org.springframework.data.r2dbc.repository.support.SimpleR2dbcRepository;
17: import org.springframework.data.relational.core.query.Criteria;
18: import org.springframework.data.relational.core.sql.Column;
19: import org.springframework.data.relational.core.sql.Comparison;
20: import org.springframework.data.relational.core.sql.Condition;
21: import org.springframework.data.relational.core.sql.Conditions;
22: import org.springframework.data.relational.core.sql.Expression;
23: import org.springframework.data.relational.core.sql.Select;
24: import org.springframework.data.relational.core.sql.SelectBuilder.SelectFromAndJoinCondition;
25: import org.springframework.data.relational.core.sql.Table;
26: import org.springframework.data.relational.repository.support.MappingRelationalEntityInformation;
27: import org.springframework.r2dbc.core.DatabaseClient;
28: import org.springframework.r2dbc.core.RowsFetchSpec;
29:
30: import com.swaps.gateway.domain.PlanedPrio;
31:
32: import .repository.rowmapper.UserRowMapper;
33: import com.swaps.gateway.repository.rowmapper.PriorizationSessionRowMapper;
34: import com.swaps.gateway.repository.rowmapper.PlanedPrioRowMapper;
35:
36: import reactor.core.publisher.Flux;
37: import reactor.core.publisher.Mono;
38:
39: /**
40: * Spring Data SQL reactive custom repository implementation for the PlanedPrio entity.
41: */
42: @SuppressWarnings("unused")
43: class PlanedPrioRepositoryInternalImpl extends SimpleR2dbcRepository<PlanedPrio, Long> implements PlanedPrioRepositoryInternal {
44: private final DatabaseClient db;
45: private final R2dbcEntityTemplate r2dbcEntityTemplate;
46: private final EntityManager entityManager;
47:
48: private final UserRowMapper userMapper;
49: private final PriorizationSessionRowMapper priorizationsessionMapper;
50: private final PlanedPrioRowMapper planedprioMapper;
51:
52: private final static Table entityTable = Table.aliased("planed_prio", EntityManager.ENTITY_ALIAS);
53: private final static Table stakeholderTable = Table.aliased("jhi_user", "stakeholder");
54: private final static Table prioritizationTable = Table.aliased("priorization_session", "prioritization");
55:
56:
57: public PlanedPrioRepositoryInternalImpl(R2dbcEntityTemplate template, EntityManager entityManager, UserRowMapper userMapper, PriorizationSessionRowMapper priorizationsessionMapper, PlanedPrioRowMapper planedprioMapper, R2dbcEntityOperations entityOperations,
58: R2dbcConverter converter) {
59: super(new MappingRelationalEntityInformation(converter.getMappingContext().getRequiredPersistentEntity(PlanedPrio.class)), entityOperations, converter);
60: this.db = template.getDatabaseClient();
61: this.r2dbcEntityTemplate = template;
62: this.entityManager = entityManager;
63: this.userMapper = userMapper;
64: this.priorizationsessionMapper = priorizationsessionMapper;
65: this.planedprioMapper = planedprioMapper;
66: }
67:
68: @Override
69: public Flux<PlanedPrio> findAllBy(Pageable pageable) {
70: return createQuery(pageable, null).all();
71: }
72:
73: RowsFetchSpec<PlanedPrio> createQuery(Pageable pageable, Condition whereClause) {
74: List<Expression> columns = PlanedPrioSqlHelper.getColumns(entityTable, EntityManager.ENTITY_ALIAS);
75: columns.addAll(UserSqlHelper.getColumns(stakeholderTable, "stakeholder"));
76: columns.addAll(PriorizationSessionSqlHelper.getColumns(prioritizationTable, "prioritization"));
77: SelectFromAndJoinCondition selectFrom = Select.builder().select(columns).from(entityTable)
78: .leftOuterJoin(stakeholderTable).on(Column.create("stakeholder_id", entityTable)).equals(Column.create("id", stakeholderTable ))
79: .leftOuterJoin(prioritizationTable).on(Column.create("prioritization_id", entityTable)).equals(Column.create("id", prioritizationTable ))
80: ;
81: // we do not support Criteria here for now as of https://github.com/jhipster/generator-jhipster/issues/18269
82: String select = entityManager.createSelect(selectFrom, PlanedPrio.class, pageable, whereClause);
83: return db.sql(select).map(this::process);
84: }
85:
86: @Override
87: public Flux<PlanedPrio> findAll() {
88: return findAllBy(null);
89: }
90:
91: @Override
92: public Mono<PlanedPrio> findById(Long id) {
93: Comparison whereClause = Conditions.isEqual(entityTable.column("id"), Conditions.just(id.toString()));
94: return createQuery(null, whereClause).one();
95: }
96:
97: private PlanedPrio process(Row row, RowMetadata metadata) {
98: PlanedPrio entity = planedprioMapper.apply(row, "e");
99: entity.setStakeholder(userMapper.apply(row, "stakeholder"));
100: entity.setPrioritization(priorizationsessionMapper.apply(row, "prioritization"));
101: return entity;
102: }
103:
104: @Override
105: public <S extends PlanedPrio> Mono<S> save(S entity) {
106: return super.save(entity);
107: }
108:
109: }
110:
Error: Error parsing file src/main/java/com/swaps/gateway/repository/PlanedPrioRepositoryInternalImpl.java: undefined
At: 1: package com.swaps.gateway.repository;
2:
3: import java.util.function.BiFunction;
4: import java.util.ArrayList;
5: import java.util.List;
6: import java.util.Map;
7: import java.util.Map.Entry;
8: import java.util.Optional;
9: import org.springframework.data.domain.Pageable;
10: import io.r2dbc.spi.Row;
11: import io.r2dbc.spi.RowMetadata;
12: import static org.springframework.data.relational.core.query.Criteria.where;
13: import org.springframework.data.r2dbc.convert.R2dbcConverter;
14: import org.springframework.data.r2dbc.core.R2dbcEntityOperations;
15: import org.springframework.data.r2dbc.core.R2dbcEntityTemplate;
16: import org.springframework.data.r2dbc.repository.support.SimpleR2dbcRepository;
17: import org.springframework.data.relational.core.query.Criteria;
18: import org.springframework.data.relational.core.sql.Column;
19: import org.springframework.data.relational.core.sql.Comparison;
20: import org.springframework.data.relational.core.sql.Condition;
21: import org.springframework.data.relational.core.sql.Conditions;
22: import org.springframework.data.relational.core.sql.Expression;
23: import org.springframework.data.relational.core.sql.Select;
24: import org.springframework.data.relational.core.sql.SelectBuilder.SelectFromAndJoinCondition;
25: import org.springframework.data.relational.core.sql.Table;
26: import org.springframework.data.relational.repository.support.MappingRelationalEntityInformation;
27: import org.springframework.r2dbc.core.DatabaseClient;
28: import org.springframework.r2dbc.core.RowsFetchSpec;
29:
30: import com.swaps.gateway.domain.PlanedPrio;
31:
32: import .repository.rowmapper.UserRowMapper;
33: import com.swaps.gateway.repository.rowmapper.PriorizationSessionRowMapper;
34: import com.swaps.gateway.repository.rowmapper.PlanedPrioRowMapper;
35:
36: import reactor.core.publisher.Flux;
37: import reactor.core.publisher.Mono;
38:
39: /**
40: * Spring Data SQL reactive custom repository implementation for the PlanedPrio entity.
41: */
42: @SuppressWarnings("unused")
43: class PlanedPrioRepositoryInternalImpl extends SimpleR2dbcRepository<PlanedPrio, Long> implements PlanedPrioRepositoryInternal {
44: private final DatabaseClient db;
45: private final R2dbcEntityTemplate r2dbcEntityTemplate;
46: private final EntityManager entityManager;
47:
48: private final UserRowMapper userMapper;
49: private final PriorizationSessionRowMapper priorizationsessionMapper;
50: private final PlanedPrioRowMapper planedprioMapper;
51:
52: private final static Table entityTable = Table.aliased("planed_prio", EntityManager.ENTITY_ALIAS);
53: private final static Table stakeholderTable = Table.aliased("jhi_user", "stakeholder");
54: private final static Table prioritizationTable = Table.aliased("priorization_session", "prioritization");
55:
56:
57: public PlanedPrioRepositoryInternalImpl(R2dbcEntityTemplate template, EntityManager entityManager, UserRowMapper userMapper, PriorizationSessionRowMapper priorizationsessionMapper, PlanedPrioRowMapper planedprioMapper, R2dbcEntityOperations entityOperations,
58: R2dbcConverter converter) {
59: super(new MappingRelationalEntityInformation(converter.getMappingContext().getRequiredPersistentEntity(PlanedPrio.class)), entityOperations, converter);
60: this.db = template.getDatabaseClient();
61: this.r2dbcEntityTemplate = template;
62: this.entityManager = entityManager;
63: this.userMapper = userMapper;
64: this.priorizationsessionMapper = priorizationsessionMapper;
65: this.planedprioMapper = planedprioMapper;
66: }
67:
68: @Override
69: public Flux<PlanedPrio> findAllBy(Pageable pageable) {
70: return createQuery(pageable, null).all();
71: }
72:
73: RowsFetchSpec<PlanedPrio> createQuery(Pageable pageable, Condition whereClause) {
74: List<Expression> columns = PlanedPrioSqlHelper.getColumns(entityTable, EntityManager.ENTITY_ALIAS);
75: columns.addAll(UserSqlHelper.getColumns(stakeholderTable, "stakeholder"));
76: columns.addAll(PriorizationSessionSqlHelper.getColumns(prioritizationTable, "prioritization"));
77: SelectFromAndJoinCondition selectFrom = Select.builder().select(columns).from(entityTable)
78: .leftOuterJoin(stakeholderTable).on(Column.create("stakeholder_id", entityTable)).equals(Column.create("id", stakeholderTable ))
79: .leftOuterJoin(prioritizationTable).on(Column.create("prioritization_id", entityTable)).equals(Column.create("id", prioritizationTable ))
80: ;
81: // we do not support Criteria here for now as of https://github.com/jhipster/generator-jhipster/issues/18269
82: String select = entityManager.createSelect(selectFrom, PlanedPrio.class, pageable, whereClause);
83: return db.sql(select).map(this::process);
84: }
85:
86: @Override
87: public Flux<PlanedPrio> findAll() {
88: return findAllBy(null);
89: }
90:
91: @Override
92: public Mono<PlanedPrio> findById(Long id) {
93: Comparison whereClause = Conditions.isEqual(entityTable.column("id"), Conditions.just(id.toString()));
94: return createQuery(null, whereClause).one();
95: }
96:
97: private PlanedPrio process(Row row, RowMetadata metadata) {
98: PlanedPrio entity = planedprioMapper.apply(row, "e");
99: entity.setStakeholder(userMapper.apply(row, "stakeholder"));
100: entity.setPrioritization(priorizationsessionMapper.apply(row, "prioritization"));
101: return entity;
102: }
103:
104: @Override
105: public <S extends PlanedPrio> Mono<S> save(S entity) {
106: return super.save(entity);
107: }
108:
109: }
110:
at patternSpy.dot (/Users/mraible/Downloads/18498/node_modules/generator-jhipster/generators/generator-transforms.js:79:15)
at async PTransform.transform [as _transform] (/Users/mraible/Downloads/18498/node_modules/p-transform/index.js:127:7)
at async PTransform.queuedTransform (/Users/mraible/Downloads/18498/node_modules/p-transform/index.js:88:26)
at async run (/Users/mraible/Downloads/18498/node_modules/p-queue/dist/index.js:163:29)
ERROR! Error parsing file src/main/java/com/swaps/gateway/repository/PlanedPrioRepositoryInternalImpl.java: undefined
As for liquibase, using the fully-qualified name seems to work:
https://stackoverflow.com/a/58542369/65681
mvn org.liquibase:liquibase-maven-plugin:diff
I don't see the liquibase plugin defined in pom.xml
. I thought this might be because your app is reactive, so I tried re-generating with reactive: false
. It's still not there with non-reactive apps.
This issue is stale because it has been open for too long without any activity. Due to the moving nature of jhipster generated application, bugs can become invalid. If this issue still applies please comment otherwise it will be closed in 7 days
Overview of the issue
When I try to run man liquidate:diff an error occur and it says that no plugin found for prefix 'liquibase'
No plugin found for prefix 'liquibase' in the current project and in the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (/Users/michel/.m2/repository), central (https://repo.maven.apache.org/maven2)] -> [Help 1]
Motivation for or Use Case
the function has worked for a long time and recently this error appears.
Reproduce the error
maven pom not changed
JHipster Version(s)
7.6.0
JHipster configuration
INFO! Using JHipster version installed globally Welcome to the JHipster Information Sub-Generator
JHipster Version(s)
JHipster configuration, a
.yo-rc.json
file generated in the root folder.yo-rc.json file
JDL for the Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryJDL entity definitions
Environment and Tools
openjdk version "11.0.14.1" 2022-02-08 OpenJDK Runtime Environment Homebrew (build 11.0.14.1+0) OpenJDK 64-Bit Server VM Homebrew (build 11.0.14.1+0, mixed mode)
git version 2.35.1
node: v16.14.2
npm: 8.5.0
Docker version 20.10.14, build a224086
Docker Compose version v2.4.1
Entity configuration(s)
entityName.json
files generated in the.jhipster
directoryBrowsers and Operating System