Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Jan 25, 2024
1 parent 197a3d1 commit 56e3a12
Showing 1 changed file with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) { _%>
Expand Down Expand Up @@ -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) {
Expand All @@ -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;
}
<%_ } _%>
<%_ } _%>
Expand All @@ -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;
}
Expand All @@ -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) { %>+ "'" <% } %>+
<%_ } _%>
"}";
}
Expand Down

0 comments on commit 56e3a12

Please sign in to comment.