dimanche 17 mai 2015

how to convert self iterating ArrlyList into json using Jackson

i want to convert List data into below json structure for this i had fetched data from mysql into arraylist and also written the pojo class EducationDTO .

{
"id": "1",
"name": "EDUCATION",
"data": "",
"children": [
    {
        "id": "1",
        "name": "STREAM-ENGG",
        "data": "",
        "children": [
            {
                "id": "1",
                "name": "COMPUTER SCIENCE",
                "data": "",
                "children": [
                    {
                        "id": "1",
                        "name": "YEAR-01",
                        "data": ""
                    }
                ]
            },
            {
                "id": "1",
                "name": "EXTC",
                "data": "",
                "children": [
                    {
                        "id": "1",
                        "name": "YEAR-01",
                        "data": ""
                    }
                ]
            }
        ]
    }
]

}

Aucun commentaire:

Enregistrer un commentaire