templet.model.vm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wk-code-generator-nb Show documentation
Show all versions of wk-code-generator-nb Show documentation
java web development framework, base on nutz
package $packageName;
import BaseModel;
import org.nutz.dao.entity.annotation.*;
import java.io.Serializable;
#foreach ($import in $table.Imports)
#if ($import)
import $import;
#else
#end
#end
${table.TableAnnotation}("${table.name}")
public class ${table.ClassName} extends BaseModel implements Serializable {
private static final long serialVersionUID = 1L;
#foreach ($column in $table.EnumColumns)
public static enum $column.SimpleJavaTypeName {
#foreach ($value in $column.EnumValues)
$value#if( $foreach.hasNext ),#end
#end
}
#end
#foreach ($column in $table.Columns)
$column.ColumnAnnotation
#foreach ($validation in $column.Validations)
$validation.Annotation
#end
private $column.SimpleJavaTypeName ${column.FieldName}#if ($column.DefaultValue) = ${column.DefaultValueCode}#end;
#end
#foreach ($column in $table.columns)
public void ${column.SetterMethodName}($column.SimpleJavaTypeName $column.FieldName) {
this.$column.FieldName = ${column.FieldName};
}
public $column.SimpleJavaTypeName ${column.GetterMethodName}() {
return this.${column.FieldName};
}
#end
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy