-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
….3x to 6.6.x
- Loading branch information
There are no files selected for viewing
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 Error loading related location Loading 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 Error loading related location Loading 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 Error loading related location Loading Check notice Code scanning / CodeQL Missing Override annotation Note
This method overrides
MultiTenantConnectionProvider<>.getConnection Error loading related location Loading |
||
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 Error loading related location Loading Check notice Code scanning / CodeQL Missing Override annotation Note
This method overrides
MultiTenantConnectionProvider<>.releaseConnection Error loading related location Loading |
||
|
||
} | ||
|
||
@Override | ||
public boolean supportsAggressiveRelease() { | ||
return false; | ||
} | ||
|
||
} |