I use @query to Insert X,Y to Geometry in PostgreSQL.
@Modifying
@Query(value = " insert into mypoints (name,geom) values (:name,SRID=4326;POINT(:x :y))", nativeQuery = true)
@Transactional
void addSPCTY(@Param("name") String ten,@Param("x") String x,@Param("y") String y);
Right now it ends up with an error
Error in Java:
org.postgresql.util.PSQLException: ERROR: syntax error near ;
SRID=4326;POINT(:x :y)
be more likeST_GeomFromText('POINT(-71.060316 48.432044)', 4326))
(I dont know java). See: Inserting point into PostGIS?