templates1.Domain.tmpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of coder-maven-plugin Show documentation
Show all versions of coder-maven-plugin Show documentation
Assist in generating CRUD code, without limitation on the specific language, as long as you can write velocity templates.
package ${packagePrefix}.entity;
import java.io.Serializable;
import java.util.Date;
/**
*
* @ClassName ${className}
* @Description
* @author ${author}
* @version V1.0
* @since V1.0
* @date ${date}
*
*/
public class ${className} implements Serializable {
#if($pkResult.size()!=1)
@EmbeddedId
private PK pk = new PK();
#else
private ${keyType} ${keyVar} ;
#end
#foreach($prop in $columnResult)
/**
* $prop.comments
*
*/
private ${prop.dataType} ${prop.javaName} ;
#end
#foreach($prop in $pkResult)
// $prop.comments
public ${prop.dataType} ${prop.getterMethod} () {
#if($pkResult.size()>1)
return pk.${prop.javaName};
#else
return this.${prop.javaName};
#end
}
#end
#foreach($prop in $columnResult)
public ${prop.dataType} ${prop.getterMethod} () {
return ${prop.javaName};
}
#end
#foreach($prop in $pkResult)
public void ${prop.setterMethod} (${prop.dataType} ${prop.javaName}) {
#if($pkResult.size()>1)
this.pk.${prop.javaName} = ${prop.javaName};
#else
this.${prop.javaName} = ${prop.javaName};
#end
}
#end
#foreach($prop in $columnResult)
public void ${prop.setterMethod} (${prop.dataType} ${prop.javaName}) {
this.${prop.javaName} = ${prop.javaName};
}
#end
#if($pkResult.size()>1)
public static class PK implements Serializable {
#foreach($prop in $pkResult)
private ${prop.dataType} ${prop.javaName} ;
#end
}
#end
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy