com.jpattern.orm.crud.ColumnValueGeneratorFactory Maven / Gradle / Ivy
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