rm-generator.1.2.1.source-code.service_validator.vm Maven / Gradle / Ivy
## Velocity template to generate the validator for all generated Java Service classes
package $class.PackageName;
#if ($class.hasDataSourceName())
import org.noorm.jdbc.DataSourceProvider;
#end
import org.noorm.validation.ServiceValidator;
/**
* Validator for all Java Services generated in $class.PackageName
* DO NOT EDIT! This file has been auto-generated by NoORM
*/
public class GenericServiceValidator {
#if ($class.hasDataSourceName())
private static final String DATA_SOURCE_NAME = "$class.getDataSourceName()";
#end
private ServiceValidator serviceValidator = new ServiceValidator();
public void validateDatabase() {
#if ($class.hasDataSourceName())
DataSourceProvider.setActiveDataSource(DATA_SOURCE_NAME);
#end
#foreach ($className in $class.ClassNames)
serviceValidator.validateService(new ${className}());
#end
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy