Javadoc for GeneratorCreationContext

This commit is contained in:
Steve Ebersole 2024-09-18 08:17:34 -05:00
parent 4fbc8f96ef
commit 9e89bdd85a
1 changed files with 34 additions and 5 deletions

View File

@ -4,6 +4,8 @@
*/
package org.hibernate.generator;
import java.util.Properties;
import org.hibernate.Incubating;
import org.hibernate.boot.model.relational.Database;
import org.hibernate.mapping.PersistentClass;
@ -13,26 +15,53 @@ import org.hibernate.service.ServiceRegistry;
import org.hibernate.type.Type;
/**
* An object passed as a parameter to the constructor or
* {@link AnnotationBasedGenerator#initialize initialize}
* method of a {@link Generator} which provides access to
* certain objects useful for initialization of the
* generator.
* Access to information useful during {@linkplain Generator} creation and initialization.
*
* @see AnnotationBasedGenerator
* @see org.hibernate.id.Configurable#configure(GeneratorCreationContext, Properties)
*
* @since 6.2
*/
@Incubating
public interface GeneratorCreationContext {
/**
* View of the relational database objects (tables, sequences, ...) and namespaces (catalogs and schemas).
*/
Database getDatabase();
/**
* Access to available services.
*/
ServiceRegistry getServiceRegistry();
/**
* The default catalog name, if one.
*/
String getDefaultCatalog();
/**
* The default schema name, if one.
*/
String getDefaultSchema();
/**
* Mapping details for the entity.
*/
PersistentClass getPersistentClass();
/**
* Mapping details for the root of the {@linkplain #getPersistentClass() entity} hierarchy.
*/
RootClass getRootClass();
/**
* The entity identifier or id-bag property details.
*/
Property getProperty();
/**
* Mapping details for the identifier type.
*/
default Type getType() {
return getProperty().getType();
}