@@ -52,17 +52,17 @@ protected Collection<Class<?>> annotatedEntities() {
52
52
public void testFindSelect (VertxTestContext context ) {
53
53
Foo foo = new Foo ( new Bar ( "unique" ) );
54
54
test ( context , getSessionFactory ()
55
- .withTransaction ( session -> session
56
- .persist ( foo )
57
- .thenCompose ( v -> session .flush () )
58
- .thenAccept ( v -> session .clear () )
59
- .thenCompose ( v -> session .find ( Foo .class , foo .id ) )
55
+ .withTransaction ( session -> session
56
+ .persist ( foo )
57
+ .thenCompose ( v -> session .flush () )
58
+ .thenAccept ( v -> session .clear () )
59
+ .thenCompose ( v -> session .find ( Foo .class , foo .id ) )
60
60
// .thenApply( result -> {
61
61
// assertFalse( Hibernate.isInitialized( result.bar) );
62
62
// return result;
63
63
// } )
64
- .thenCompose ( result -> session .fetch ( result .bar ) )
65
- .thenAccept ( bar -> assertEquals ( "unique" , bar .key ) ) )
64
+ .thenCompose ( result -> session .fetch ( result .bar ) )
65
+ .thenAccept ( bar -> assertEquals ( "unique" , bar .key ) ) )
66
66
);
67
67
}
68
68
@@ -76,7 +76,7 @@ public void testMergeDetached(VertxTestContext context) {
76
76
.thenCompose ( result -> getSessionFactory ()
77
77
.withTransaction ( session -> session .fetch ( result .bar )
78
78
.thenAccept ( b -> assertEquals ( "unique2" , b .key ) )
79
- ) ) );
79
+ ) ) );
80
80
}
81
81
82
82
@ Test
@@ -85,12 +85,15 @@ public void testMergeReference(VertxTestContext context) {
85
85
test ( context , getSessionFactory ()
86
86
.withTransaction ( session -> session .persist ( bar ) )
87
87
.thenCompose ( i -> getSessionFactory ()
88
- .withTransaction ( session -> session .merge ( new Foo ( session .getReference ( Bar .class , bar .id ) ) ) )
88
+ .withTransaction ( session -> session .merge ( new Foo ( session .getReference (
89
+ Bar .class ,
90
+ bar .id
91
+ ) ) ) )
89
92
)
90
93
.thenCompose ( result -> getSessionFactory ()
91
- .withTransaction ( session -> session .fetch ( result .bar )
92
- .thenAccept ( b -> assertEquals ( "unique3" , b .key ) )
93
- ) ) );
94
+ .withTransaction ( session -> session .fetch ( result .bar )
95
+ .thenAccept ( b -> assertEquals ( "unique3" , b .key ) )
96
+ ) ) );
94
97
}
95
98
96
99
@ Test
@@ -99,13 +102,13 @@ public void testPersistReference(VertxTestContext context) {
99
102
test ( context , getSessionFactory ()
100
103
.withTransaction ( session -> session .persist ( bar ) )
101
104
.thenCompose ( i -> getSessionFactory ()
102
- .withTransaction ( session -> {
105
+ .withTransaction ( session -> {
103
106
Foo foo = new Foo ( session .getReference ( Bar .class , bar .id ) );
104
107
return session .persist ( foo ).thenApply ( v -> foo );
105
108
} )
106
109
)
107
110
.thenCompose ( result -> getSessionFactory ()
108
- .withTransaction ( session -> session .fetch ( result .bar )
111
+ .withTransaction ( session -> session .fetch ( result .bar )
109
112
.thenAccept ( b -> assertEquals ( "unique3" , b .getKey () ) )
110
113
) ) );
111
114
}
0 commit comments