Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception
[Request processing failed: org.springframework.dao.DataIntegrityViolationException: could not execute statement
[ERROR: insert or update on table "order" violates foreign key constraint "order_customer_id_fkey"
Detail: Key (customer_id)=(0) is not present in table "customer".]
[insert into order (id, order_date, customer_id, total_amount) values (?,?,?,?)];
constraint [order_customer_id_fkey]] with root cause
org.postgresql.util.PSQLException: ERROR: insert or update on table "order" violates foreign key constraint "order_customer_id_fkey"
При попытке вставить объект Order в базу данных PostgreSQL я получаю следующее исключение: [code]Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed: org.springframework.dao.DataIntegrityViolationException: could not execute statement [ERROR: insert or update on table "order" violates foreign key constraint "order_customer_id_fkey" Detail: Key (customer_id)=(0) is not present in table "customer".] [insert into order (id, order_date, customer_id, total_amount) values (?,?,?,?)]; constraint [order_customer_id_fkey]] with root cause
org.postgresql.util.PSQLException: ERROR: insert or update on table "order" violates foreign key constraint "order_customer_id_fkey" [/code] вот объект: [code]@Entity @Table(name = "order") public class Order { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id;