skip to Main Content

Postgresql – DATA/JPA Entity with String key – but replace data when try to save object with same key

I have this Entity class with nickname String as a key. @Data @Entity @Table(name="players") public class Player { @Id private String nickname; @Column(name="name") private String name; @Column(name="surname") private String surname; ... ... ... } Controller @PostMapping(value="/addPlayer", consumes = {MediaType.APPLICATION_JSON_VALUE}, produces…

VIEW QUESTION

Postgresql – postgres table functions

Hi I have some questions regarding table functions in PostgreSQL From https://www.postgresql.org/docs/16/queries-table-expressions.html#QUERIES-TABLEFUNCTIONS CREATE TABLE foo (fooid int, foosubid int, fooname text); CREATE FUNCTION getfoo(int) RETURNS SETOF foo AS $$ SELECT * FROM foo WHERE fooid = $1; $$ LANGUAGE SQL;…

VIEW QUESTION
Back To Top
Search