diff --git a/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/service/dto/_dtoClass_.java.ejs b/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/service/dto/_dtoClass_.java.ejs index 62d93d7e4e83..63fdae75cb8b 100644 --- a/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/service/dto/_dtoClass_.java.ejs +++ b/generators/spring-boot/templates/src/main/java/_package_/_entityPackage_/service/dto/_dtoClass_.java.ejs @@ -16,7 +16,7 @@ See the License for the specific language governing permissions and limitations under the License. -%> -package <%= entityAbsolutePackage %>.service.dto; +package <%- entityAbsolutePackage %>.service.dto; import java.util.Objects; <%_ if (entityApiDescription || importApiModelProperty) { _%> @@ -55,21 +55,21 @@ import java.util.UUID; import jakarta.persistence.Lob; <%_ } _%> <%_ Object.keys(uniqueEnums).forEach(function(element) { _%> -import <%= entityAbsolutePackage %>.domain.enumeration.<%= element %>; +import <%- entityAbsolutePackage %>.domain.enumeration.<%- element %>; <%_ }); _%> <%_ for (const otherEntity of otherEntities.filter(otherEntity => otherEntity.entityPackage !== entityPackage)) { _%> -import <%= `${otherEntity.entityAbsolutePackage}.service.dto.${otherEntity.dtoClass}` %>; +import <%- `${otherEntity.entityAbsolutePackage}.service.dto.${otherEntity.dtoClass}` %>; <%_ } _%> /** - * A DTO for the {@link <%= entityAbsolutePackage %>.domain.<%= persistClass %>} entity. + * A DTO for the {@link <%- entityAbsolutePackage %>.domain.<%- persistClass %>} entity. */ <%_ if (entityApiDescription) { _%> @Schema(description = "<%- entityApiDescription %>") <%_ } _%> @SuppressWarnings("common-java:DuplicatedBlocks") -public class <%= dtoClass %> implements Serializable { +public class <%- dtoClass %> implements Serializable { <%_ for (property of restProperties) { if (typeof property.propertyJavadoc) { @@ -90,30 +90,30 @@ _%> <%_ if (property.fieldTypeBytes && databaseTypeSql) { _%> @Lob <%_ } _%> - private <%= property.propertyDtoJavaType %> <%= property.propertyName %><% if (property.collection && relationship) { %> = new HashSet<>()<% } %>; + private <%- property.propertyDtoJavaType %> <%- property.propertyName %><% if (property.collection && relationship) { %> = new HashSet<>()<% } %>; <%_ if (property.fieldWithContentType) { _%> - private String <%= property.propertyName %>ContentType; + private String <%- property.propertyName %>ContentType; <%_ } } _%> <%_ for (property of restProperties) { _%> public <%- property.propertyDtoJavaType %> get<%- property.propertyJavaBeanName %>() { - return <%= property.propertyName %>; + return <%- property.propertyName %>; } public void set<%- property.propertyJavaBeanName %>(<%- property.propertyDtoJavaType %> <%- property.propertyName %>) %> { - this.<%= property.propertyName %> = <%= property.propertyName %>; + this.<%- property.propertyName %> = <%- property.propertyName %>; } <%_ if (property.fieldWithContentType) { _%> - public String get<%= property.propertyJavaBeanName %>ContentType() { - return <%= property.propertyName %>ContentType; + public String get<%- property.propertyJavaBeanName %>ContentType() { + return <%- property.propertyName %>ContentType; } - public void set<%= property.propertyJavaBeanName %>ContentType(String <%= property.propertyName %>ContentType) { - this.<%= property.propertyName %>ContentType = <%= property.propertyName %>ContentType; + public void set<%- property.propertyJavaBeanName %>ContentType(String <%- property.propertyName %>ContentType) { + this.<%- property.propertyName %>ContentType = <%- property.propertyName %>ContentType; } <%_ } _%> <%_ } _%> @@ -124,12 +124,12 @@ _%> if (this == o) { return true; } - if (!(o instanceof <%= dtoClass %>)) { + if (!(o instanceof <%- dtoClass %>)) { return false; } <%_ if (!embedded) { _%> - <%= dtoClass %> <%= dtoInstance %> = (<%= dtoClass %>) o; + <%- dtoClass %> <%- dtoInstance %> = (<%- dtoClass %>) o; if (<%- idNames.map(n => `this.${n} == null`).join(' && ') %>){ return false; } @@ -151,10 +151,10 @@ _%> // prettier-ignore @Override public String toString() { - return "<%= dtoClass %>{" + + return "<%- dtoClass %>{" + <%_ for ([idx, property] of restProperties.entries()) { const isQuoted = property.fieldName && !property.fieldTypeNumeric _%> - "<%= idx === 0 ? '' : ', ' %><%= property.propertyName %>=<% if (isQuoted) { %>'<% } %>" + get<%- property.propertyJavaBeanName %>() <% if (isQuoted) { %>+ "'" <% } %>+ + "<%- idx === 0 ? '' : ', ' %><%- property.propertyName %>=<% if (isQuoted) { %>'<% } %>" + get<%- property.propertyJavaBeanName %>() <% if (isQuoted) { %>+ "'" <% } %>+ <%_ } _%> "}"; }