public class HibernateMappingProvider extends Object implements org.hibernate.boot.spi.SessionFactoryBuilderFactory
Hibernate SPI implementor that harvests metadata about all of the entity classes
This is registered within META-INF/services/org.hibernate.boot.spi.SessionFactoryBuilderFactory and listens to the session factory being created with all of the metadata
Constructor and Description |
---|
HibernateMappingProvider() |
HibernateMappingProvider(Map<String,org.hibernate.mapping.PersistentClass> metadataMap)
Initialize with seed data independent of
getSessionFactoryBuilder(MetadataImplementor, SessionFactoryBuilderImplementor) |
Modifier and Type | Method and Description |
---|---|
static Collection<org.hibernate.mapping.PersistentClass> |
getAllMappings()
Retrieves all Hibernate metadata for all entities
|
static org.hibernate.mapping.PersistentClass |
getMapping(String entityClass)
Returns the underlying Hibernate metadata about a given entity class across all available persistence units
|
static List<String> |
getPropertyNames(String entityClass)
Retrieve the names of all of the Hibernate mapped properties for the given entityClass
|
static List<org.hibernate.type.Type> |
getPropertyTypes(String entityClass)
Retrieve all of the types of all of the Hibernate mapped properties for the given entityClass
|
org.hibernate.boot.SessionFactoryBuilder |
getSessionFactoryBuilder(org.hibernate.boot.spi.MetadataImplementor metadata,
org.hibernate.boot.spi.SessionFactoryBuilderImplementor defaultBuilder) |
public HibernateMappingProvider()
public HibernateMappingProvider(Map<String,org.hibernate.mapping.PersistentClass> metadataMap)
getSessionFactoryBuilder(MetadataImplementor, SessionFactoryBuilderImplementor)
metadataMap
- seed datapublic org.hibernate.boot.SessionFactoryBuilder getSessionFactoryBuilder(org.hibernate.boot.spi.MetadataImplementor metadata, org.hibernate.boot.spi.SessionFactoryBuilderImplementor defaultBuilder)
getSessionFactoryBuilder
in interface org.hibernate.boot.spi.SessionFactoryBuilderFactory
@Nullable public static org.hibernate.mapping.PersistentClass getMapping(String entityClass)
entityClass
- FQN of a Hibernate entity@NonNull public static List<String> getPropertyNames(String entityClass)
entityClass
- mapped classgetPropertyTypes(String)
@NonNull public static List<org.hibernate.type.Type> getPropertyTypes(String entityClass)
entityClass
- mapped classgetPropertyNames(String)
@NonNull public static Collection<org.hibernate.mapping.PersistentClass> getAllMappings()
PersistentClass
across all registered persistence unitsCopyright © 2022. All rights reserved.