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

com.jpattern.orm.annotation.version.VersionInfoFactory Maven / Gradle / Ivy

There is a newer version: 6.3.0
Show newest version
package com.jpattern.orm.annotation.version;

import java.lang.reflect.Field;

import com.jpattern.orm.annotation.Version;
import com.jpattern.orm.query.LockMode;

/**
 * 
 * @author cinafr
 *
 */
public class VersionInfoFactory {

	private VersionInfoFactory() {}

	public static  VersionInfo getVersionInfo(final Field field) {
		final Version version = field.getAnnotation(Version.class);
		if (version!=null) {
			LockMode lockMode = version.lock();
			boolean versionable = true;
			return new VersionInfoImpl(lockMode, versionable);
		}
		return new VersionInfoImpl(LockMode.NO_LOCK, false);
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy