Persisting JSON Creating List Objects

1

Good afternoon guys,

I'm having a question, I'm trying to persist a JSON via the API:

{
 ...
        "Analise": [{
            "nProcAnalitic": "SR-000446/2015",
            ...
        }]
...
}

And the service answers 200:

...
  "Analise": [
    {
      "id": null,
      "lotEntity": null,
      "nProcAnalitic": "SR-000446/2015"
...

But without creating the object of the listing, only the parent object.

Mapping:

@JsonProperty ("Analyze") @OneToMany (mappedBy="lotEntity") private List analysis;

...

@ManyToOne @JoinColumn (name="id_lot") private LotEntity lotEntity;

    
asked by anonymous 13.11.2016 / 19:35

1 answer

0

I think you just need to specify the cascade = ALL property in oneToMany annotation, so JPA will persist / change / delete cascading child objects.

    
15.11.2016 / 13:18