A
A
Alexander Batula2019-10-10 17:21:04
PostgreSQL
Alexander Batula, 2019-10-10 17:21:04

How to link nested object by outer object id?

Good afternoon! Faced such a problem, there is a Json object where one more object is nested. How to link a nested object by the id of the outer object of one json file. I tried to use Hibernate annotations but nothing comes out.
For example:

{
    "total": 1,
    "items": [
        {
            "path": 4444",
            "id":  34",
            "nmb": 6,
            "name": "teeest",
            "width": 0,
            "height": 0,
            "campaignNmb": 8,
            "campaignId": "1",
            "Auto": {
                "id": 13",
                "nmb": 144,
                "name": "test",
                "alias": "App"
            },
}

There should be a relation @OneToManyfrom "User" to "Auto" - where in the auto table the last column would be id - User.
Help I will be glad to any answer.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question