Reputation: 1596
Jackson @JsonIgnoreProperties not ignoring possibleTargets ,but ignoring owner and lemf .How i can ignore lists.
@JsonIgnoreProperties( {"owner","lemf"," possibleTargets"} )
@Entity
public class Warrant extends Nameable {
@LazyCollection(LazyCollectionOption.FALSE)
@OneToMany(mappedBy ="warrant",targetEntity = com.endersys.lims.model.Target.class)
private List<Target> possibleTargets;
Output:
[{"status":"SCHEDULED","startDate":1320962400000,"endDate":1320962400000,"caseId":"1","possibleTargets":[],"name":"warrant_1","description":"decription","identity":"warrant_1","version":1,"systemId":1,"active":true}]
Upvotes: 2
Views: 3142
Reputation: 179
Use Jackson version 2.4 it works perfectly.
This is how you can implemented:
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties({"id"})
In this developerWork post I found an example to implement Jackson v2.4 all the code and library is available.
Upvotes: 0