@@ -806,6 +806,43 @@ describe("change log integration test", () => {
806
806
const deleteTitleChange = deleteTitleChanges [ 0 ] ;
807
807
expect ( deleteTitleChange . objectID ) . to . equal ( "new title, In Preparation, France" ) ;
808
808
809
+ // Check object ID "bookStore.city.country.countryName.code" when creating BookStores/Books
810
+ // (parent/child) at the same time.
811
+ cds . services . AdminService . entities . Books [ "@changelog" ] = [
812
+ { "=" : "bookStore.city.country.countryName.code" } ,
813
+ ] ;
814
+
815
+ const createBooksAndBookStoresAction = POST . bind ( { } , `/odata/v4/admin/BookStores` , {
816
+ ID : "48268451-8552-42a6-a3d7-67564be86634" ,
817
+ city_ID : "60b4c55d-ec87-4edc-84cb-2e4ecd60de48" ,
818
+ books : [
819
+ {
820
+ ID : "12ed5dd8-d45b-11ed-afa1-1942bd119007" ,
821
+ title : "New title" ,
822
+ } ,
823
+ ] ,
824
+ } ) ;
825
+
826
+ await utils . apiAction (
827
+ "admin" ,
828
+ "BookStores" ,
829
+ "48268451-8552-42a6-a3d7-67564be86634" ,
830
+ "AdminService" ,
831
+ createBooksAndBookStoresAction ,
832
+ true ,
833
+ ) ;
834
+
835
+ const createBooksAndBookStoresChanges = await adminService . run (
836
+ SELECT . from ( ChangeView ) . where ( {
837
+ entity : "sap.capire.bookshop.Books" ,
838
+ attribute : "title" ,
839
+ modification : "create" ,
840
+ } ) ,
841
+ ) ;
842
+ expect ( createBooksAndBookStoresChanges . length ) . to . equal ( 1 ) ;
843
+ const createBooksAndBookStoresChange = createBooksAndBookStoresChanges [ 0 ] ;
844
+ expect ( createBooksAndBookStoresChange . objectID ) . to . equal ( "USA" ) ;
845
+
809
846
cds . services . AdminService . entities . Books [ "@changelog" ] = [
810
847
{ "=" : "title" } ,
811
848
{ "=" : "author.name.firstName" } ,
0 commit comments