templates0.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 org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.mapping.Document;
import java.util.Date;
/**
*
* @ClassName ${className}
* @Description
* @author ${author}
* @version V1.0
* @since V1.0
* @date ${date}
*
*/
@Document(collection="${tableName}")
public class ${className} {
@Id
private ${keyType} ${keyVar} ;
#foreach($prop in $columnResult)
// "$prop.comments"
private ${prop.dataType} ${prop.javaName} ;
#end
#foreach($prop in $pkResult)
// "$prop.comments"
public ${prop.dataType} ${prop.getterMethod} () {
return this.${prop.javaName};
}
#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}) {
this.${prop.javaName} = ${prop.javaName};
}
#end
#foreach($prop in $columnResult)
public void ${prop.setterMethod} (${prop.dataType} ${prop.javaName}) {
this.${prop.javaName} = ${prop.javaName};
}
#end
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy