Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump hibernate.version from 6.3.1.Final to 6.6.1.Final #715

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
</ciManagement>

<properties>
<hibernate.version>6.3.1.Final</hibernate.version>
<hibernate.version>6.6.1.Final</hibernate.version>
<spring.version>6.1.13</spring.version>
<liquibase.version>4.29.2</liquibase.version>
<maven.compiler.source>11</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected void configureSources(MetadataSources sources) throws DatabaseExceptio
ServiceRegistry standardRegistry = configuration.getStandardServiceRegistryBuilder()
.applySettings(config.getProperties())
.addService(ConnectionProvider.class, new NoOpConnectionProvider())
.addService(MultiTenantConnectionProvider.class, new NoOpConnectionProvider())
.addService(MultiTenantConnectionProvider.class, new NoOpMultiTenantConnectionProvider())
.build();

config.buildSessionFactory(standardRegistry);
Expand All @@ -67,4 +67,4 @@ protected String getDefaultDatabaseProductName() {
}


}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
import org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider;
import org.hibernate.service.ServiceRegistry;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.concurrent.atomic.AtomicReference;

/**
Expand Down Expand Up @@ -189,7 +187,7 @@ protected MetadataSources createMetadataSources() throws DatabaseException {
.applySetting(AvailableSettings.DIALECT, dialect)
.applySetting(HibernateDatabase.HIBERNATE_TEMP_USE_JDBC_METADATA_DEFAULTS, Boolean.FALSE.toString())
.addService(ConnectionProvider.class, new NoOpConnectionProvider())
.addService(MultiTenantConnectionProvider.class, new NoOpConnectionProvider())
.addService(MultiTenantConnectionProvider.class, new NoOpMultiTenantConnectionProvider())
.build();

return new MetadataSources(standardRegistry);
Expand Down Expand Up @@ -334,54 +332,4 @@ public boolean supportsCatalogs() {
return true;
}

/**
* Used by hibernate to ensure no database access is performed.
*/
static class NoOpConnectionProvider implements ConnectionProvider, MultiTenantConnectionProvider {

@Override
public Connection getConnection() throws SQLException {
throw new SQLException("No connection");
}

@Override
public void closeConnection(Connection conn) throws SQLException {

}

@Override
public boolean supportsAggressiveRelease() {
return false;
}

@Override
public boolean isUnwrappableAs(Class unwrapType) {
return false;
}

@Override
public <T> T unwrap(Class<T> unwrapType) {
return null;
}

@Override
public Connection getAnyConnection() throws SQLException {
return getConnection();
}

@Override
public void releaseAnyConnection(Connection connection) throws SQLException {

}

@Override
public Connection getConnection(String tenantIdentifier) throws SQLException {
return getConnection();
}

@Override
public void releaseConnection(String tenantIdentifier, Connection connection) throws SQLException {

}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package liquibase.ext.hibernate.database;

import org.hibernate.engine.jdbc.connections.spi.ConnectionProvider;

import java.sql.Connection;
import java.sql.SQLException;

/**
* Used by hibernate to ensure no database access is performed.
*/
class NoOpConnectionProvider implements ConnectionProvider {

@Override
public Connection getConnection() throws SQLException {
throw new SQLException("No connection");
}

@Override
public void closeConnection(Connection conn) throws SQLException {
}

@Override
public boolean supportsAggressiveRelease() {
return false;
}

@Override
public boolean isUnwrappableAs(Class unwrapType) {
return false;
}

@Override
public <T> T unwrap(Class<T> unwrapType) {
return null;
}


public Connection getConnection(String tenantIdentifier) throws SQLException {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'tenantIdentifier' is never used.
return getConnection();
}

public Connection getConnection(Object o) throws SQLException {

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method NoOpConnectionProvider.getConnection(..) could be confused with overloaded method
getConnection
, since dispatch depends on static types.

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'o' is never used.
return getConnection();
}

public void releaseConnection(Object tenantIdentifier, Connection connection) throws SQLException {

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method NoOpConnectionProvider.releaseConnection(..) could be confused with overloaded method
releaseConnection
, since dispatch depends on static types.

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'tenantIdentifier' is never used.

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'connection' is never used.

}

public void releaseConnection(String tenantIdentifier, Connection connection) throws SQLException {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'tenantIdentifier' is never used.

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'connection' is never used.

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package liquibase.ext.hibernate.database;

import org.hibernate.engine.jdbc.connections.spi.MultiTenantConnectionProvider;

import java.sql.Connection;
import java.sql.SQLException;

/**
* Used by hibernate to ensure no database access is performed.
*/
class NoOpMultiTenantConnectionProvider implements MultiTenantConnectionProvider {

@Override
public boolean isUnwrappableAs(Class unwrapType) {
return false;
}

@Override
public <T> T unwrap(Class<T> unwrapType) {
return null;
}

@Override
public Connection getAnyConnection() throws SQLException {
return null;
}

@Override
public void releaseAnyConnection(Connection connection) throws SQLException {

}

public Connection getConnection(String s) throws SQLException {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 's' is never used.
return null;
}

public void releaseConnection(String s, Connection connection) throws SQLException {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 's' is never used.

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'connection' is never used.

}

public Connection getConnection(Object tenantIdentifier) throws SQLException {

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method NoOpMultiTenantConnectionProvider.getConnection(..) could be confused with overloaded method
getConnection
, since dispatch depends on static types.

Check notice

Code scanning / CodeQL

Missing Override annotation Note

This method overrides
MultiTenantConnectionProvider<>.getConnection
; it is advisable to add an Override annotation.
return null;
}

public void releaseConnection(Object tenantIdentifier, Connection connection) throws SQLException {

Check notice

Code scanning / CodeQL

Confusing overloading of methods Note

Method NoOpMultiTenantConnectionProvider.releaseConnection(..) could be confused with overloaded method
releaseConnection
, since dispatch depends on static types.

Check notice

Code scanning / CodeQL

Missing Override annotation Note

This method overrides
MultiTenantConnectionProvider<>.releaseConnection
; it is advisable to add an Override annotation.

}

@Override
public boolean supportsAggressiveRelease() {
return false;
}

}
Loading