protected IdsClauseBuilder( Dialect dialect, Type identifierType, TypeConfiguration typeConfiguration, String[] columns, List<Object[]> ids) { this.dialect = dialect; this.identifierType = identifierType; this.typeResolver = typeConfiguration.getTypeResolver(); this.columns = columns; this.ids = ids; }
/** * Obtain the ServiceRegistry scoped to the TypeConfiguration. * * @apiNote Depending on what the {@link Scope} is currently scoped to will determine where the * {@link ServiceRegistry} is obtained from. * * @return The ServiceRegistry */ public ServiceRegistry getServiceRegistry() { return scope.getServiceRegistry(); }
/** * Obtain the MetadataBuildingContext currently scoping the * TypeConfiguration. * * @apiNote This will throw an exception if the SessionFactory is not yet * bound here. See {@link Scope} for more details regarding the stages * a TypeConfiguration goes through * * @return */ public MetadataBuildingContext getMetadataBuildingContext() { return scope.getMetadataBuildingContext(); }
/** * Locate a Hibernate {@linkplain BasicType basic type} given (one of) its registration names. * * @param name The registration name * * @return The registered type */ public BasicType basic(String name) { return typeConfiguration.getBasicTypeRegistry().getRegisteredType( name ); }
@Override @SuppressWarnings("unchecked") public BasicJavaDescriptor getJdbcRecommendedJavaTypeMapping(TypeConfiguration typeConfiguration) { return (BasicJavaDescriptor) typeConfiguration.getJavaTypeDescriptorRegistry().getDescriptor( UUID.class ); }
public void registerTypeConfiguration(TypeConfiguration typeConfiguration) { if ( configurationMap == null ) { configurationMap = new ConcurrentHashMap<>(); } configurationMap.put( typeConfiguration.getUuid(), typeConfiguration ); }
@Override public void sessionFactoryCreated(SessionFactory factory) { // Instead of allowing scope#setSessionFactory to influence this, we use the SessionFactoryObserver callback // to handle this, allowing any SessionFactory constructor code to be able to continue to have access to the // MetadataBuildingContext through TypeConfiguration until this callback is fired. log.tracef( "Handling #sessionFactoryCreated from [%s] for TypeConfiguration", factory ); scope.setMetadataBuildingContext( null ); }
public SessionFactoryImplementor resolveSessionFactory() { return typeConfiguration.getSessionFactory(); }
/** * Obtain the SessionFactory currently scoping the TypeConfiguration. * * @apiNote This will throw an exception if the SessionFactory is not yet * bound here. See {@link Scope} for more details regarding the stages * a TypeConfiguration goes through (this is "runtime stage") * * @return The SessionFactory * * @throws IllegalStateException if the TypeConfiguration is currently not * associated with a SessionFactory (in "runtime stage"). */ public SessionFactoryImplementor getSessionFactory() { return scope.getSessionFactory(); }
@Override public void sessionFactoryClosed(SessionFactory factory) { log.tracef( "Handling #sessionFactoryClosed from [%s] for TypeConfiguration", factory ); TypeConfigurationRegistry.INSTANCE.deregisterTypeConfiguration( this ); scope.unsetSessionFactory( factory ); // todo (6.0) : finish this // release Database, descriptor Maps, etc... things that are only // valid while the TypeConfiguration is scoped to SessionFactory }
public void registerTypeOverride(CompositeUserType type, String[] keys) { typeConfiguration.getBasicTypeRegistry().register( type, keys ); }
/** * Retrieve the {@link Type} resolver associated with this factory. * * @return The type resolver * * @deprecated (since 5.3) No replacement, access to and handling of Types will be much different in 6.0 */ @Deprecated public TypeResolver getTypeResolver() { return bootstrapContext.getTypeConfiguration().getTypeResolver(); }
@Override public org.hibernate.type.descriptor.java.spi.JavaTypeDescriptorRegistry getJavaTypeDescriptorRegistry() { return metadata.getTypeConfiguration().getJavaTypeDescriptorRegistry(); } }
private Object readResolve() throws InvalidObjectException { log.trace( "Resolving serialized TypeConfiguration - readResolve" ); return TypeConfigurationRegistry.INSTANCE.findTypeConfiguration( getUuid() ); } }
public void scope(MetadataBuildingContext metadataBuildingContext) { log.debugf( "Scoping TypeConfiguration [%s] to MetadataBuildingContext [%s]", this, metadataBuildingContext ); scope.setMetadataBuildingContext( metadataBuildingContext ); }
final BasicTypeRegistry getBasicTypeRegistry() { return bootstrapContext.getTypeConfiguration().getBasicTypeRegistry(); }
/** * Retrieve the {@link Type} resolver associated with this factory. * * @return The type resolver * * @deprecated (since 5.3) No replacement, access to and handling of Types will be much different in 6.0 */ @Deprecated public TypeResolver getTypeResolver() { return bootstrapContext.getTypeConfiguration().getTypeResolver(); }
public void registerTypeOverride(BasicType type) { typeConfiguration.getBasicTypeRegistry().register( type ); }
/** * Retrieve the {@link Type} resolver associated with this factory. * * @return The type resolver * * @deprecated (since 5.3) No replacement, access to and handling of Types will be much different in 6.0 */ @Deprecated public TypeResolver getTypeResolver() { return metamodel.getTypeConfiguration().getTypeResolver(); }
public void registerTypeOverride(UserType type, String[] keys) { typeConfiguration.getBasicTypeRegistry().register( type, keys ); }