use of org.hibernate.metamodel.mapping.internal.EntityVersionMappingImpl in project hibernate-orm by hibernate.
the class AbstractEntityPersister method generateVersionMapping.
/**
* @param entityPersister The AbstractEntityPersister being constructed - still initializing
* @param bootModelRootEntityDescriptor The boot-time entity descriptor for the "root entity" in the hierarchy
* @param creationProcess The SF creation process - access to useful things
*/
protected static EntityVersionMapping generateVersionMapping(AbstractEntityPersister entityPersister, Supplier<?> templateInstanceCreator, PersistentClass bootModelRootEntityDescriptor, MappingModelCreationProcess creationProcess) {
final Property versionProperty = bootModelRootEntityDescriptor.getVersion();
final BasicValue bootModelVersionValue = (BasicValue) versionProperty.getValue();
final BasicValue.Resolution<?> basicTypeResolution = bootModelVersionValue.resolve();
final Column column = (Column) bootModelVersionValue.getColumn();
final Dialect dialect = creationProcess.getCreationContext().getSessionFactory().getJdbcServices().getDialect();
return new EntityVersionMappingImpl(bootModelRootEntityDescriptor.getRootClass(), templateInstanceCreator, bootModelRootEntityDescriptor.getVersion().getName(), entityPersister.getTableName(), column.getText(dialect), column.getSqlType(), column.getLength(), column.getPrecision(), column.getScale(), basicTypeResolution.getLegacyResolvedBasicType(), entityPersister, creationProcess);
}
Aggregations