All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates1.Domain.tmpl Maven / Gradle / Ivy

Go to download

Assist in generating CRUD code, without limitation on the specific language, as long as you can write velocity templates.

There is a newer version: 1.0.8
Show newest version

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