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

rm-generator.1.5.0.source-code.enum.vm Maven / Gradle / Ivy

The newest version!
## Velocity template to generate Java Enum classes
package $class.PackageName;

import org.noorm.jdbc.IEnum;
import org.noorm.jdbc.JDBCColumn;

/**
 * Enum class for database table $class.TableName
 * DO NOT EDIT! This file has been auto-generated by NoORM
 */
public enum $class.Name implements IEnum {

#foreach ($rec in $class.Records)
	$rec.getDisplayColumnValue()(#foreach ($att in $class.Attributes)$rec.getFormattedValue($att)#if($foreach.count<$class.Attributes.size()), #end#end)#if($foreach.count<$class.Records.size()),#else;#end${force_newline}
#end

	private static final String TABLE_NAME = "$class.TableName";
	private static final String DISPLAY_COLUMN_NAME = "$class.DisplayColumnName";
#foreach ($att in $class.Attributes)
	@JDBCColumn(name="$att.ColumnName")
	private final $att.Type $att.Name;
#end

	$class.getName()(#foreach ($att in $class.Attributes)final $att.Type p$att.getMethodNamePostfix()#if($foreach.count<$class.Attributes.size()), #end#end) {
#foreach ($att in $class.Attributes)
		$att.Name = p$att.getMethodNamePostfix();
#end
	}

    @Override
	public String getTableName() {
		return TABLE_NAME;
	}

    @Override
	public String getDisplayColumnName() {
		return DISPLAY_COLUMN_NAME;
	}
#foreach ($att in $class.Attributes)

	public $att.Type get$att.getMethodNamePostfix()() {
		return $att.Name;
	}
#end
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy