org.hibernate.metamodel.RuntimeMetamodels Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of beangle-hibernate-core Show documentation
Show all versions of beangle-hibernate-core Show documentation
Hibernate Orm Core Shade,Support Scala Collection
/*
* 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 http://www.gnu.org/licenses/lgpl-2.1.html
*/
package org.hibernate.metamodel;
import org.hibernate.Incubating;
import org.hibernate.metamodel.mapping.EmbeddableValuedModelPart;
import org.hibernate.metamodel.mapping.EntityMappingType;
import org.hibernate.metamodel.mapping.PluralAttributeMapping;
import org.hibernate.metamodel.model.domain.JpaMetamodel;
import org.hibernate.metamodel.model.domain.NavigableRole;
/**
* Entry point providing access to the runtime metamodels:
*
* - the {@linkplain JpaMetamodel domain model}, our implementation of the
* JPA-defined {@linkplain jakarta.persistence.metamodel.Metamodel model}
* of the Java types, and
*
- our {@linkplain MappingMetamodel relational mapping model} of how these
* types are made persistent.
*
*
* @author Steve Ebersole
*/
@Incubating
public interface RuntimeMetamodels {
/**
* Access to the JPA / domain metamodel.
*/
JpaMetamodel getJpaMetamodel();
/**
* Access to the relational mapping model.
*/
MappingMetamodel getMappingMetamodel();
// some convenience methods...
default EntityMappingType getEntityMappingType(String entityName) {
return getMappingMetamodel().getEntityDescriptor( entityName );
}
default EntityMappingType getEntityMappingType(Class entityType) {
return getMappingMetamodel().getEntityDescriptor( entityType );
}
default PluralAttributeMapping getPluralAttributeMapping(String role) {
return getMappingMetamodel().findCollectionDescriptor( role ).getAttributeMapping();
}
/**
* @deprecated Use {@link #getEmbedded(NavigableRole)} instead
*/
@Deprecated
EmbeddableValuedModelPart getEmbedded(String role);
EmbeddableValuedModelPart getEmbedded(NavigableRole role);
default String getImportedName(String name) {
return getMappingMetamodel().getImportedName( name );
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy