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

rm-generator.1.2.1.source-code.enum_validator.vm Maven / Gradle / Ivy

There is a newer version: 1.5.0
Show newest version
## Velocity template to generate the validator for all generated Java Enum classes
package $class.PackageName;

#if ($class.hasDataSourceName())
import org.noorm.jdbc.DataSourceProvider;
#end
import org.noorm.validation.EnumValidator;

/**
 * Validator for all Java Enums generated in $class.PackageName
 * DO NOT EDIT! This file has been auto-generated by NoORM
 */
public class GenericEnumValidator {

#if ($class.hasDataSourceName())
	private static final String DATA_SOURCE_NAME = "$class.getDataSourceName()";
#end
	private EnumValidator enumValidator = new EnumValidator();

	public void validateDatabase() {

#if ($class.hasDataSourceName())
		DataSourceProvider.setActiveDataSource(DATA_SOURCE_NAME);
#end
		enumValidator.loadMetadata("$class.getTableSearchPattern()");
#foreach ($className in $class.ClassNames)
		enumValidator.validateEnum(${className}.class);
#end
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy