mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-03-08 02:40:24 +00:00
remove unnecessary casts
This commit is contained in:
parent
5f516cb350
commit
687e5cdd0e
@ -28,7 +28,7 @@ public class TransactionUtil2 {
|
|||||||
public static void inSession(SessionFactoryImplementor sfi, Consumer<SessionImplementor> action) {
|
public static void inSession(SessionFactoryImplementor sfi, Consumer<SessionImplementor> action) {
|
||||||
log.trace( "#inSession(SF,action)" );
|
log.trace( "#inSession(SF,action)" );
|
||||||
|
|
||||||
try (SessionImplementor session = (SessionImplementor) sfi.openSession()) {
|
try (SessionImplementor session = sfi.openSession()) {
|
||||||
log.trace( "Session opened, calling action" );
|
log.trace( "Session opened, calling action" );
|
||||||
action.accept( session );
|
action.accept( session );
|
||||||
log.trace( "called action" );
|
log.trace( "called action" );
|
||||||
@ -41,7 +41,7 @@ public static void inSession(SessionFactoryImplementor sfi, Consumer<SessionImpl
|
|||||||
public static <R> R fromSession(SessionFactoryImplementor sfi, Function<SessionImplementor,R> action) {
|
public static <R> R fromSession(SessionFactoryImplementor sfi, Function<SessionImplementor,R> action) {
|
||||||
log.trace( "#inSession(SF,action)" );
|
log.trace( "#inSession(SF,action)" );
|
||||||
|
|
||||||
try (SessionImplementor session = (SessionImplementor) sfi.openSession()) {
|
try (SessionImplementor session = sfi.openSession()) {
|
||||||
log.trace( "Session opened, calling action" );
|
log.trace( "Session opened, calling action" );
|
||||||
return action.apply( session );
|
return action.apply( session );
|
||||||
}
|
}
|
||||||
@ -54,7 +54,7 @@ public static <R> R inSessionReturn(SessionFactoryImplementor sfi, Function<Sess
|
|||||||
log.trace( "#inSession(SF,action)" );
|
log.trace( "#inSession(SF,action)" );
|
||||||
|
|
||||||
R result = null;
|
R result = null;
|
||||||
try (SessionImplementor session = (SessionImplementor) sfi.openSession()) {
|
try (SessionImplementor session = sfi.openSession()) {
|
||||||
log.trace( "Session opened, calling action" );
|
log.trace( "Session opened, calling action" );
|
||||||
result = action.apply( session );
|
result = action.apply( session );
|
||||||
log.trace( "called action" );
|
log.trace( "called action" );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user