how can I add this child field to parentDTO?

50 Views Asked by At

I have this two entities

entity Country {
name String                                                                                   
}                                                                             
entity Regions {
name String
population Integer                                                                            
}

And i wanna get something like this

{
"id": 1,
"name": "USA",
"regions": 
        [
            {
                "id": 1                    
                "name": "florida"
                "population":150000"
            },
             {
                "id": 2                    
                "name": "newyork"
                "population":12"
            },
        ]   

}

I also tried to do List regions in jdl but it doesnt work in jdl studio i get error! Can you please tell me how to do it even with the code and Thanks.

0

There are 0 best solutions below