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

rm-generator.1.2.1.source-code.service_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 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