template.domain.entity-resp.vm Maven / Gradle / Ivy
package ${package.EntityResp};
import java.io.Serializable;
#if(${table.hasDate})
import java.util.Date;
#end
#foreach($field in ${table.fields})
#if(${field.propertyType.equals('BigDecimal')})
import java.math.BigDecimal;
#break
#end
#end
/**
*
* ${table.comment}
*
*
* @author ${author}
* @since ${date}
*/
public class ${entity}Resp implements Serializable {
private static final long serialVersionUID = 1L;
#foreach($field in ${table.fields})
/**
* ${field.comment}
*/
private ${field.propertyType} ${field.propertyName};
#end
#foreach($field in ${table.fields})
#if(${field.propertyType.equals("Boolean")})
#set($getprefix="is")
#else
#set($getprefix="get")
#end
public ${field.propertyType} ${getprefix}${field.capitalName}() {
return ${field.propertyName};
}
public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
this.${field.propertyName} = ${field.propertyName};
}
#end
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("${entity}{").append(super.toString());
#foreach($field in ${table.fields})
#if(${field.propertyType.equals("String")})
sb.append(",${field.propertyName}='").append(${field.propertyName}).append('\'');
#else
sb.append(",${field.propertyName}=").append(${field.propertyName});
#end
#end
sb.append('}');
return sb.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy