38
38
@ SessionFactory (generateStatistics = true )
39
39
public class EntityWithOneToOneJoinTableTest {
40
40
41
+ final int maxInt = Integer .MAX_VALUE - 1 ;
42
+ final int minInt = Integer .MIN_VALUE + 1 ;
43
+
41
44
@ BeforeEach
42
45
public void setUp (SessionFactoryScope scope ) {
43
- EntityWithOneToOneJoinTable entity = new EntityWithOneToOneJoinTable ( 1 , "first" , Integer . MAX_VALUE );
46
+ EntityWithOneToOneJoinTable entity = new EntityWithOneToOneJoinTable ( 1 , "first" , maxInt );
44
47
45
48
SimpleEntity other = new SimpleEntity (
46
49
2 ,
47
50
Calendar .getInstance ().getTime (),
48
51
null ,
49
- Integer . MAX_VALUE ,
52
+ maxInt ,
50
53
Long .MAX_VALUE ,
51
54
null
52
55
);
@@ -65,7 +68,7 @@ public void setUp(SessionFactoryScope scope) {
65
68
EntityWithOneToOneJoinTable entity2 = new EntityWithOneToOneJoinTable (
66
69
2 ,
67
70
"second" ,
68
- Integer . MAX_VALUE
71
+ maxInt
69
72
);
70
73
71
74
SimpleEntity other2 = new SimpleEntity (
@@ -115,7 +118,7 @@ public void testGet(SessionFactoryScope scope) {
115
118
session -> {
116
119
final SimpleEntity loaded = session .get ( SimpleEntity .class , 2 );
117
120
assert loaded != null ;
118
- assertThat ( loaded .getSomeInteger (), equalTo ( Integer . MAX_VALUE ) );
121
+ assertThat ( loaded .getSomeInteger (), equalTo ( maxInt ) );
119
122
}
120
123
);
121
124
}
@@ -225,7 +228,7 @@ public void testHqlSelectParentWithJoinFetch(SessionFactoryScope scope) {
225
228
226
229
@ Test
227
230
public void testUpdate (SessionFactoryScope scope ) {
228
- EntityWithOneToOneJoinTable entity = new EntityWithOneToOneJoinTable ( 3 , "first" , Integer . MAX_VALUE );
231
+ EntityWithOneToOneJoinTable entity = new EntityWithOneToOneJoinTable ( 3 , "first" , maxInt );
229
232
230
233
SimpleEntity other = new SimpleEntity (
231
234
4 ,
@@ -249,7 +252,7 @@ public void testUpdate(SessionFactoryScope scope) {
249
252
5 ,
250
253
Calendar .getInstance ().getTime (),
251
254
null ,
252
- Integer . MIN_VALUE ,
255
+ minInt ,
253
256
Long .MAX_VALUE ,
254
257
null
255
258
);
0 commit comments