diff --git a/generators/server/templates/entity/src/main/java/package/service/impl/_EntityClass_ServiceImpl.java.ejs b/generators/server/templates/entity/src/main/java/package/service/impl/_EntityClass_ServiceImpl.java.ejs index 06244f01edea..e0ad573cf71d 100644 --- a/generators/server/templates/entity/src/main/java/package/service/impl/_EntityClass_ServiceImpl.java.ejs +++ b/generators/server/templates/entity/src/main/java/package/service/impl/_EntityClass_ServiceImpl.java.ejs @@ -194,9 +194,9 @@ public class <%= serviceClassName %><% if (serviceImpl) { %> implements <%= enti public <% if (paginationNo) { %><%= listOrFlux %><% } else { %><%= pageOrFlux %><% } %><<%= instanceType %>> findByCriteria(<%= entityClass %>Criteria criteria<% if (!paginationNo) { %>, Pageable pageable<% } %>) { log.debug("Request to get all <%= entityClassPlural %> by Criteria"); <%_ if (paginationNo) { _%> - return <%= entityInstance %>Repository.findByCriteria(criteria, null); + return <%= entityInstance %>Repository.findByCriteria(criteria, null)<% if (dtoMapstruct) { %>.map(<%= entityToDtoReference %>)<% } %>; <%_ } else { _%> - return <%= entityInstance %>Repository.findByCriteria(criteria, pageable); + return <%= entityInstance %>Repository.findByCriteria(criteria, pageable)<% if (dtoMapstruct) { %>.map(<%= entityToDtoReference %>)<% } %>; <%_ } _%> } diff --git a/generators/server/templates/src/main/java/package/domain/User.java.ejs b/generators/server/templates/src/main/java/package/domain/User.java.ejs index db61b4a2ee33..fcb124f044f3 100644 --- a/generators/server/templates/src/main/java/package/domain/User.java.ejs +++ b/generators/server/templates/src/main/java/package/domain/User.java.ejs @@ -134,7 +134,7 @@ import static org.springframework.data.couchbase.core.mapping.id.GenerationStrat <%_ if (searchEngineElasticsearch) { _%> @org.springframework.data.elasticsearch.annotations.Document(indexName = "user") <%_ } _%> -public class <%= user.persistClass %><% if (databaseTypeSql || databaseTypeMongodb || databaseTypeNeo4j || databaseTypeCouchbase) { %> extends AbstractAuditingEntity<<%= user.primaryKey.type %>><% } %> implements Serializable<% if (databaseTypeSql && reactive && requiresPersistableImplementation) { %>, Persistable<% } %> { +public class <%= user.persistClass %><% if (databaseTypeSql || databaseTypeMongodb || databaseTypeNeo4j || databaseTypeCouchbase) { %> extends AbstractAuditingEntity<<%= user.primaryKey.type %>><% } %> implements Serializable<% if (databaseTypeSql && reactive && requiresPersistableImplementation) { %>, Persistable<<% if (user.primaryKey.hasUUID) { %>UUID<% } else { %>String<% } %>><% } %> { private static final long serialVersionUID = 1L; diff --git a/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs b/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs index e26d8df61601..2f39971291bc 100644 --- a/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs +++ b/generators/server/templates/src/main/java/package/repository/UserRepository.java.ejs @@ -288,7 +288,7 @@ public interface UserRepository extends <% if (databaseTypeSql) { %>JpaRepositor } <%_ } else if (databaseTypeSql && reactive) { _%> @Repository -public interface UserRepository extends R2dbcRepository<<%= user.persistClass %>, <% if (authenticationTypeOauth2) { %>String<% } else { %>Long<% } %>>, UserRepositoryInternal { +public interface UserRepository extends R2dbcRepository<<%= user.persistClass %>, <% if (authenticationTypeOauth2) { %>String<% } else { %><%= user.primaryKey.type %><% } %>>, UserRepositoryInternal { <%_ if (!authenticationTypeOauth2) { _%> Mono<<%= user.persistClass %>> findOneByActivationKey(String activationKey); diff --git a/generators/spring-data-elasticsearch/templates/src/main/java/package/repository/search/UserSearchRepository.java.ejs b/generators/spring-data-elasticsearch/templates/src/main/java/package/repository/search/UserSearchRepository.java.ejs index 9d685f6ce680..c469a3644f18 100644 --- a/generators/spring-data-elasticsearch/templates/src/main/java/package/repository/search/UserSearchRepository.java.ejs +++ b/generators/spring-data-elasticsearch/templates/src/main/java/package/repository/search/UserSearchRepository.java.ejs @@ -41,7 +41,7 @@ import org.springframework.transaction.annotation.Transactional; import java.util.stream.Stream; <%_ } _%> -<%_ if (databaseTypeCassandra) { _%> +<%_ if (databaseTypeCassandra || user.primaryKey.hasUUID) { _%> import java.util.UUID; <%_ } _%> diff --git a/generators/spring-data-relational/templates/src/main/java/_package_/repository/rowmapper/UserRowMapper_reactive.java.ejs b/generators/spring-data-relational/templates/src/main/java/_package_/repository/rowmapper/UserRowMapper_reactive.java.ejs index 0bcf2e71d449..187590434d9b 100644 --- a/generators/spring-data-relational/templates/src/main/java/_package_/repository/rowmapper/UserRowMapper_reactive.java.ejs +++ b/generators/spring-data-relational/templates/src/main/java/_package_/repository/rowmapper/UserRowMapper_reactive.java.ejs @@ -20,6 +20,9 @@ package <%= packageName %>.repository.rowmapper; import java.time.Instant; +<%_ if (user.primaryKey.hasUUID) { _%> +import java.util.UUID; +<%_ } _%> import java.util.function.BiFunction; import org.springframework.stereotype.Service;