HHH-13081 - Pass BootstrapContext to Integrator#integrate;

HHH-11990 - Remove LogicalConnectionImplementor#makeShareableCopy

6.0 Alpha3 prep
This commit is contained in:
Steve Ebersole 2019-11-23 08:51:37 -06:00
parent 0d803cf25f
commit 056469262d
7 changed files with 66 additions and 35 deletions

View File

@ -3,6 +3,34 @@ Hibernate 5 Changelog
Note: Please refer to JIRA to learn more about each issue.
Changes in 6.0.0.Alpha1 (November 23, 2019)
------------------------------------------------------------------------------------------------------------------------
https://hibernate.atlassian.net/projects/HHH/versions/31768/
** Sub-task
* [HHH-13714] - HQL/Criteria UPDATE support
* [HHH-13715] - HQL/Criteria DELETE support
** New Feature
* [HHH-11474] - Implement support for LIMIT and OFFSET clause
** Task
* [HHH-13395] - Update Envers to use the new Integrator signature.
* [HHH-13725] - Implement ToOne Associations support
* [HHH-13732] - Implement OneToOne support
** Improvement
* [HHH-11828] - Adjust EntityMode, Tuplizer and friends to the 6.0 metamodel (Navigable et.al.) contracts
* [HHH-13081] - Pass BootstrapContext to Integrator#integrate
* [HHH-13224] - Look at removing references to SessionFactory from various components
** Remove Feature
* [HHH-10071] - Remove support for "collection properties" in HQL
* [HHH-11990] - Remove LogicalConnectionImplementor#makeShareableCopy
Changes in 5.4.9.Final (November 14, 2019)
------------------------------------------------------------------------------------------------------------------------

View File

@ -8,7 +8,7 @@
apply plugin: 'base'
ext {
ormVersion = new HibernateVersion( '6.0.0-SNAPSHOT', project )
ormVersion = new HibernateVersion( '6.0.0.Alpha3', project )
baselineJavaVersion = '1.8'
jpaVersion = new JpaVersion('2.2')
}

View File

@ -6,7 +6,9 @@
*/
package org.hibernate.integrator.spi;
import org.hibernate.Incubating;
import org.hibernate.boot.Metadata;
import org.hibernate.boot.spi.BootstrapContext;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.service.spi.SessionFactoryServiceRegistry;
@ -27,11 +29,33 @@ public interface Integrator {
* @param metadata The "compiled" representation of the mapping information
* @param sessionFactory The session factory being created
* @param serviceRegistry The session factory's service registry
* @deprecated (since 6.0) - use
*/
public void integrate(
@Deprecated
default void integrate(
Metadata metadata,
SessionFactoryImplementor sessionFactory,
SessionFactoryServiceRegistry serviceRegistry);
SessionFactoryServiceRegistry serviceRegistry) {
throw new UnsupportedOperationException( "Call to un-implemented deprecated legacy `Integrator#integrate` overload form" );
}
/**
* Perform integration.
*
* @param metadata The fully initialized boot-time mapping model
* @param bootstrapContext The context for bootstrapping of the SessionFactory
* @param sessionFactory The SessionFactory being created
*
* todo (6.0) : why pass the `serviceRegistry`? Why not just grab it from the SessionFactory?
*/
@Incubating
default void integrate(
Metadata metadata,
BootstrapContext bootstrapContext,
SessionFactoryImplementor sessionFactory) {
// simply call the legacy one, keeping implementors bytecode compatible.
integrate( metadata, sessionFactory, (SessionFactoryServiceRegistry) sessionFactory.getServiceRegistry() );
}
/**
* Tongue-in-cheek name for a shutdown callback.
@ -39,6 +63,6 @@ public interface Integrator {
* @param sessionFactory The session factory being closed.
* @param serviceRegistry That session factory's service registry
*/
public void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry);
void disintegrate(SessionFactoryImplementor sessionFactory, SessionFactoryServiceRegistry serviceRegistry);
}

View File

@ -11,7 +11,6 @@ import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@ -32,7 +31,6 @@ import javax.persistence.PersistenceException;
import javax.persistence.PersistenceUnitUtil;
import javax.persistence.Query;
import javax.persistence.SynchronizationType;
import javax.persistence.spi.PersistenceUnitTransactionType;
import org.hibernate.ConnectionAcquisitionMode;
import org.hibernate.ConnectionReleaseMode;
@ -52,6 +50,8 @@ import org.hibernate.StatelessSessionBuilder;
import org.hibernate.boot.cfgxml.spi.CfgXmlAccessService;
import org.hibernate.boot.cfgxml.spi.LoadedConfig;
import org.hibernate.boot.registry.classloading.spi.ClassLoaderService;
import org.hibernate.boot.spi.BootstrapContext;
import org.hibernate.boot.spi.MetadataBuildingContext;
import org.hibernate.boot.spi.MetadataImplementor;
import org.hibernate.boot.spi.SessionFactoryOptions;
import org.hibernate.cache.cfg.internal.DomainDataRegionConfigImpl;
@ -79,7 +79,6 @@ import org.hibernate.engine.profile.Fetch;
import org.hibernate.engine.profile.FetchProfile;
import org.hibernate.engine.spi.FilterDefinition;
import org.hibernate.engine.spi.SessionBuilderImplementor;
import org.hibernate.engine.spi.SessionEventListenerManager;
import org.hibernate.engine.spi.SessionFactoryImplementor;
import org.hibernate.engine.spi.SessionOwner;
import org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform;
@ -203,6 +202,10 @@ public final class SessionFactoryImpl implements SessionFactoryImplementor {
SessionFactoryOptions options) {
LOG.debug( "Building session factory" );
final TypeConfiguration typeConfiguration = bootMetamodel.getTypeConfiguration();
final MetadataBuildingContext bootModelBuildingContext = typeConfiguration.getMetadataBuildingContext();
final BootstrapContext bootstrapContext = bootModelBuildingContext.getBootstrapContext();
this.sessionFactoryOptions = options;
this.settings = new Settings( options, bootMetamodel );
@ -275,7 +278,7 @@ public final class SessionFactoryImpl implements SessionFactoryImplementor {
this.observer.addObserver( integratorObserver );
try {
for ( Integrator integrator : serviceRegistry.getService( IntegratorService.class ).getIntegrators() ) {
integrator.integrate( bootMetamodel, this, this.serviceRegistry );
integrator.integrate( bootMetamodel, bootstrapContext, this );
integratorObserver.integrators.add( integrator );
}
//Generators:
@ -295,10 +298,10 @@ public final class SessionFactoryImpl implements SessionFactoryImplementor {
primeSecondLevelCacheRegions( bootMetamodel );
this.metamodel = bootMetamodel.getTypeConfiguration().scope( this );
this.metamodel = typeConfiguration.scope( this );
( (DomainMetamodelImpl) metamodel ).finishInitialization(
bootMetamodel,
bootMetamodel.getTypeConfiguration().getMetadataBuildingContext().getBootstrapContext(),
bootstrapContext,
this
);

View File

@ -21,7 +21,6 @@ import org.hibernate.engine.jdbc.spi.SqlExceptionHelper;
import org.hibernate.resource.jdbc.ResourceRegistry;
import org.hibernate.resource.jdbc.spi.JdbcObserver;
import org.hibernate.resource.jdbc.spi.JdbcSessionContext;
import org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor;
import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
import org.jboss.logging.Logger;
@ -201,14 +200,6 @@ public class LogicalConnectionManagedImpl extends AbstractLogicalConnectionImple
}
}
@Override
public LogicalConnectionImplementor makeShareableCopy() {
errorIfClosed();
// todo : implement
return null;
}
@Override
public void serialize(ObjectOutputStream oos) throws IOException {
oos.writeBoolean( closed );

View File

@ -13,7 +13,6 @@ import java.sql.Connection;
import org.hibernate.resource.jdbc.LogicalConnection;
import org.hibernate.resource.jdbc.ResourceRegistry;
import org.hibernate.resource.jdbc.spi.LogicalConnectionImplementor;
import org.hibernate.resource.jdbc.spi.PhysicalConnectionHandlingMode;
import org.jboss.logging.Logger;
@ -81,13 +80,6 @@ public class LogicalConnectionProvidedImpl extends AbstractLogicalConnectionImpl
return providedConnection;
}
@Override
public LogicalConnectionImplementor makeShareableCopy() {
errorIfClosed();
return new LogicalConnectionProvidedImpl( providedConnection, new ResourceRegistryStandardImpl() );
}
@Override
public void serialize(ObjectOutputStream oos) throws IOException {
oos.writeBoolean( closed );

View File

@ -59,15 +59,8 @@ public interface LogicalConnectionImplementor extends LogicalConnection {
void manualReconnect(Connection suppliedConnection);
/**
* Creates a shareable copy of itself for use in "shared sessions"
*
* @return The shareable copy.
*
* @deprecated This method is not used by Hibernate.
* Access to the current underlying JDBC transaction
*/
@Deprecated
LogicalConnectionImplementor makeShareableCopy();
PhysicalJdbcTransaction getPhysicalJdbcTransaction();
/**