I have a class Candidate like below which has a member of Type Point which is JTS type. I can pass the name and gender in the body of post request but I do not know how to pass (Point geom) so that @RequestBody can fill the geom member of the Candidate Object.
// ..imports here
import org.locationtech.jts.geom.Point;
public class Candidate {
@Id
@SequenceGenerator(
name = "candidate_sequence",
sequenceName = "candidate_sequence",
allocationSize = 1
)
@GeneratedValue(
strategy = GenerationType.SEQUENCE,
generator = "candidate_sequence"
)
private Long id;
private String name;
private Integer gender;
@Column(columnDefinition = "geometry(Point,4326)")
private Point geom;
The API interface is like this, how to send the data for member ( private Point geom;) in the http post request
@PostMapping ("/register")
public Candidate addCandidate(@RequestBody Candidate candidate)
{
// candiate.geom is null..
return candidateService.addCandidate(candidate);
}