squash two warnings

This commit is contained in:
Gavin 2023-05-17 12:59:33 +02:00 committed by Christian Beikov
parent ecaa3f0d62
commit 18ca4b41c1
2 changed files with 3 additions and 10 deletions

View File

@ -133,7 +133,6 @@ public class ThreadLocalSessionContext extends AbstractCurrentSessionContext {
* *
* @return the built or (re)obtained session. * @return the built or (re)obtained session.
*/ */
@SuppressWarnings("deprecation")
protected Session buildOrObtainSession() { protected Session buildOrObtainSession() {
return baseSessionBuilder() return baseSessionBuilder()
.autoClose( isAutoCloseEnabled() ) .autoClose( isAutoCloseEnabled() )
@ -191,8 +190,7 @@ public class ThreadLocalSessionContext extends AbstractCurrentSessionContext {
* @param session The session to bind. * @param session The session to bind.
*/ */
public static void bind(Session session) { public static void bind(Session session) {
final SessionFactory factory = session.getSessionFactory(); doBind( session, session.getSessionFactory() );
doBind( session, factory );
} }
private static void terminateOrphanedSession(Session orphan) { private static void terminateOrphanedSession(Session orphan) {

View File

@ -449,11 +449,6 @@ public class SessionFactoryImpl extends QueryParameterBindingTypeResolverImpl im
class IntegratorObserver implements SessionFactoryObserver { class IntegratorObserver implements SessionFactoryObserver {
private final ArrayList<Integrator> integrators = new ArrayList<>(); private final ArrayList<Integrator> integrators = new ArrayList<>();
@Override
public void sessionFactoryCreated(SessionFactory factory) {
}
@Override @Override
public void sessionFactoryClosed(SessionFactory factory) { public void sessionFactoryClosed(SessionFactory factory) {
for ( Integrator integrator : integrators ) { for ( Integrator integrator : integrators ) {
@ -959,8 +954,8 @@ public class SessionFactoryImpl extends QueryParameterBindingTypeResolverImpl im
} }
else { else {
final NamedQueryMemento namedQueryMemento = ( (SqmQueryImplementor<?>) hibernateQuery ).toMemento( final NamedQueryMemento namedQueryMemento =
name ); ( (SqmQueryImplementor<?>) hibernateQuery ).toMemento( name );
namedObjectRepository.registerSqmQueryMemento( namedObjectRepository.registerSqmQueryMemento(
name, name,
(NamedSqmQueryMemento) namedQueryMemento (NamedSqmQueryMemento) namedQueryMemento