@@ -716,17 +716,11 @@ void joinForSimpleReference() {
716
716
assertSoftly (softly -> {
717
717
718
718
softly .assertThat (join .joinTable ().getName ()).isEqualTo (SqlIdentifier .quoted ("REFERENCED_ENTITY" ));
719
- softly .assertThat (join .columns ()).extracting ( //
720
- pair -> pair .getFirst ().getTable (), //
721
- pair -> pair .getFirst ().getName (), //
722
- pair -> pair .getSecond ().getTable ().getName (), //
723
- pair -> pair .getSecond ().getName () //
724
- ).contains (tuple ( //
725
- join .joinTable (), //
726
- SqlIdentifier .quoted ("DUMMY_ENTITY" ), //
727
- SqlIdentifier .quoted ("DUMMY_ENTITY" ), //
728
- SqlIdentifier .quoted ("id1" ) //
729
- ));
719
+ softly .assertThat (join .condition ())
720
+ .isEqualTo (org .springframework .data .relational .core .sql .Column .create (SqlIdentifier .quoted ("DUMMY_ENTITY" ), join .joinTable ())
721
+ .isEqualTo (org .springframework .data .relational .core .sql .Column .create (SqlIdentifier .quoted ("id1" ),
722
+ org .springframework .data .relational .core .sql .Table .create (SqlIdentifier .quoted ("DUMMY_ENTITY" )))));
723
+
730
724
});
731
725
}
732
726
@@ -754,17 +748,13 @@ void joinForSecondLevelReference() {
754
748
755
749
assertSoftly (softly -> {
756
750
softly .assertThat (join .joinTable ().getName ()).isEqualTo (SqlIdentifier .quoted ("SECOND_LEVEL_REFERENCED_ENTITY" ));
757
- softly .assertThat (join .columns ()).extracting ( //
758
- pair -> pair .getFirst ().getTable (), //
759
- pair -> pair .getFirst ().getName (), //
760
- pair -> pair .getSecond ().getTable ().getName (), //
761
- pair -> pair .getSecond ().getName () //
762
- ).contains (tuple ( //
763
- join .joinTable (), //
764
- SqlIdentifier .quoted ("REFERENCED_ENTITY" ), //
765
- SqlIdentifier .quoted ("REFERENCED_ENTITY" ), //
766
- SqlIdentifier .quoted ("X_L1ID" ) //
767
- ));
751
+ softly .assertThat (join .condition ())
752
+ .isEqualTo (org .springframework .data .relational .core .sql .Column
753
+ .create (SqlIdentifier .quoted ("REFERENCED_ENTITY" ), join .joinTable ())
754
+ .isEqualTo (org .springframework .data .relational .core .sql .Column .create (SqlIdentifier .quoted ("X_L1ID" ),
755
+ org .springframework .data .relational .core .sql .Table .create ("REFERENCED_ENTITY" )
756
+ .as (SqlIdentifier .quoted ("ref" )))));
757
+
768
758
});
769
759
}
770
760
@@ -779,18 +769,13 @@ void joinForOneToOneWithoutId() {
779
769
softly .assertThat (joinTable .getName ()).isEqualTo (SqlIdentifier .quoted ("NO_ID_CHILD" ));
780
770
softly .assertThat (joinTable ).isInstanceOf (Aliased .class );
781
771
softly .assertThat (((Aliased ) joinTable ).getAlias ()).isEqualTo (SqlIdentifier .quoted ("child" ));
772
+ softly .assertThat (join .condition ())
773
+ .isEqualTo (org .springframework .data .relational .core .sql .Column
774
+ .create (SqlIdentifier .quoted ("PARENT_OF_NO_ID_CHILD" ), join .joinTable ())
775
+ .isEqualTo (org .springframework .data .relational .core .sql .Column .create (SqlIdentifier .quoted ("X_ID" ),
776
+ org .springframework .data .relational .core .sql .Table
777
+ .create (SqlIdentifier .quoted ("PARENT_OF_NO_ID_CHILD" )))));
782
778
783
- softly .assertThat (join .columns ()).extracting ( //
784
- pair -> pair .getFirst ().getTable (), //
785
- pair -> pair .getFirst ().getName (), //
786
- pair -> pair .getSecond ().getTable ().getName (), //
787
- pair -> pair .getSecond ().getName () //
788
- ).contains (tuple ( //
789
- join .joinTable (), //
790
- SqlIdentifier .quoted ("PARENT_OF_NO_ID_CHILD" ), //
791
- SqlIdentifier .quoted ("PARENT_OF_NO_ID_CHILD" ), //
792
- SqlIdentifier .quoted ("X_ID" ) //
793
- ));
794
779
});
795
780
}
796
781
0 commit comments