3838@ SessionFactory (generateStatistics = true )
3939public class EntityWithOneToOneJoinTableTest {
4040
41+ final int maxInt = Integer .MAX_VALUE - 1 ;
42+ final int minInt = Integer .MIN_VALUE + 1 ;
43+
4144 @ BeforeEach
4245 public void setUp (SessionFactoryScope scope ) {
43- EntityWithOneToOneJoinTable entity = new EntityWithOneToOneJoinTable ( 1 , "first" , Integer . MAX_VALUE );
46+ EntityWithOneToOneJoinTable entity = new EntityWithOneToOneJoinTable ( 1 , "first" , maxInt );
4447
4548 SimpleEntity other = new SimpleEntity (
4649 2 ,
4750 Calendar .getInstance ().getTime (),
4851 null ,
49- Integer . MAX_VALUE ,
52+ maxInt ,
5053 Long .MAX_VALUE ,
5154 null
5255 );
@@ -65,7 +68,7 @@ public void setUp(SessionFactoryScope scope) {
6568 EntityWithOneToOneJoinTable entity2 = new EntityWithOneToOneJoinTable (
6669 2 ,
6770 "second" ,
68- Integer . MAX_VALUE
71+ maxInt
6972 );
7073
7174 SimpleEntity other2 = new SimpleEntity (
@@ -115,7 +118,7 @@ public void testGet(SessionFactoryScope scope) {
115118 session -> {
116119 final SimpleEntity loaded = session .get ( SimpleEntity .class , 2 );
117120 assert loaded != null ;
118- assertThat ( loaded .getSomeInteger (), equalTo ( Integer . MAX_VALUE ) );
121+ assertThat ( loaded .getSomeInteger (), equalTo ( maxInt ) );
119122 }
120123 );
121124 }
@@ -225,7 +228,7 @@ public void testHqlSelectParentWithJoinFetch(SessionFactoryScope scope) {
225228
226229 @ Test
227230 public void testUpdate (SessionFactoryScope scope ) {
228- EntityWithOneToOneJoinTable entity = new EntityWithOneToOneJoinTable ( 3 , "first" , Integer . MAX_VALUE );
231+ EntityWithOneToOneJoinTable entity = new EntityWithOneToOneJoinTable ( 3 , "first" , maxInt );
229232
230233 SimpleEntity other = new SimpleEntity (
231234 4 ,
@@ -249,7 +252,7 @@ public void testUpdate(SessionFactoryScope scope) {
249252 5 ,
250253 Calendar .getInstance ().getTime (),
251254 null ,
252- Integer . MIN_VALUE ,
255+ minInt ,
253256 Long .MAX_VALUE ,
254257 null
255258 );
0 commit comments