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

com.jpattern.orm.crud.ColumnValueGeneratorFactory Maven / Gradle / Ivy

There is a newer version: 3.5.1
Show newest version
package com.jpattern.orm.crud;

import com.jpattern.orm.annotation.GeneratorType;

/**
 * 
 * @author Francesco Cina
 *
 * 13/giu/2011
 */
public abstract class ColumnValueGeneratorFactory {

	public static AColumnValueGenerator generator(GeneratorType generatorType, String name) {
		if (generatorType.equals( GeneratorType.SEQUENCE ) ) {
			return new SequenceColumnValueGenerator(name);
		}
		if (generatorType.equals( GeneratorType.AUTOGENERATED ) ) {
			return new AutogeneratedColumnValueGenerator(name);
		}
		return nullGenerator(name);
	}

	public static AColumnValueGenerator nullGenerator(String name) {
		return new NullColumnValueGenerator(name);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy