squash two warnings

This commit is contained in:
Gavin 2023-05-17 12:59:33 +02:00
parent 7372d6dc08
commit a2f1ee3364
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.
*/
@SuppressWarnings("deprecation")
protected Session buildOrObtainSession() {
return baseSessionBuilder()
.autoClose( isAutoCloseEnabled() )
@ -191,8 +190,7 @@ public class ThreadLocalSessionContext extends AbstractCurrentSessionContext {
* @param session The session to bind.
*/
public static void bind(Session session) {
final SessionFactory factory = session.getSessionFactory();
doBind( session, factory );
doBind( session, session.getSessionFactory() );
}
private static void terminateOrphanedSession(Session orphan) {

View File

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