tpl.entity.vm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wichell-common Show documentation
Show all versions of wichell-common Show documentation
common project com.wichell.wichell jar
The newest version!
package ${package.Entity};
#if(${activeRecord})
import com.baomidou.mybatisplus.activerecord.Model;
#end
#foreach($pkg in ${table.importPackages})
import ${pkg};
#end
import java.io.Serializable;
/**
*
* ${table.comment}
*
*
* @author ${author}
* @since ${date}
*/
#if(${table.convert})
@TableName("${table.name}")
#end
#if(${superEntityClass})
@SuppressWarnings("serial")
public class ${entity} extends ${superEntityClass}#if(${activeRecord})<${entity}>#end {
#elseif(${activeRecord})
public class ${entity} extends Model<${entity}> {
#else
public class ${entity} implements Serializable {
private static final long serialVersionUID = 1L;
#end
#foreach($field in ${table.fields})
#if(${field.keyFlag})
#set($keyPropertyName=${field.propertyName})
#end
#if("$!field.comment" != "")
/**
* ${field.comment}
*/
#end
#if(${field.convert})
#if(${field.keyFlag})
@TableId("${field.name}")
#else
@TableField("${field.name}")
#end
#end
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};
}
#if(${entityBuliderModel})
public ${entity} set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
#else
public void set${field.capitalName}(${field.propertyType} ${field.propertyName}) {
#end
this.${field.propertyName} = ${field.propertyName};
#if(${entityBuliderModel})
return this;
#end
}
#end
#if(${entityColumnConstant})
#foreach($field in ${table.fields})
public static final String ${field.name.toUpperCase()} = "${field.name}";
#end
#end
#if(${activeRecord})
protected Serializable pkVal() {
#if(${keyPropertyName})
return this.${keyPropertyName};
#else
return this.id;
#end
}
#end
} © 2015 - 2025 Weber Informatics LLC | Privacy Policy