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

org.hibernate.tuple.AnnotationValueGeneration Maven / Gradle / Ivy

There is a newer version: 6.6.2.Final
Show newest version
/*
 * Hibernate, Relational Persistence for Idiomatic Java
 *
 * License: GNU Lesser General Public License (LGPL), version 2.1 or later.
 * See the lgpl.txt file in the root directory or .
 */
package org.hibernate.tuple;

import java.lang.annotation.Annotation;


/**
 * A {@link ValueGeneration} based on a custom Java generator annotation type.
 *
 * @param  The generator annotation type supported by an implementation
 *
 * @author Gunnar Morling
 */
public interface AnnotationValueGeneration extends ValueGeneration {

	/**
	 * Initializes this generation strategy for the given annotation instance.
	 *
	 * @param annotation an instance of the strategy's annotation type. Typically implementations will retrieve the
	 * annotation's attribute values and store them in fields.
	 * @param propertyType the type of the property annotated with the generator annotation. Implementations may use
	 * the type to determine the right {@link ValueGenerator} to be applied.
	 *
	 * @throws org.hibernate.HibernateException in case an error occurred during initialization, e.g. if
	 * an implementation can't create a value for the given property type.
	 */
	void initialize(A annotation, Class propertyType);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy