Ошибка следующая:
Код: Выделить всё
could not execute statement [No value specified for parameter 6.]
[insert into payment_item
(account_id,x,y,active,payment_id,active,id)
values (?,?,?,?,?,?,?)]
Код: Выделить всё
CREATE TABLE payment_item (
id BIGINT,
payment_id BIGINT NOT NULL,
active BOOLEAN NOT NULL DEFAULT true ,
PRIMARY KEY (id, active),
FOREIGN KEY (payment_id, active) REFERENCES payment (id, active)
) PARTITION BY LIST (active);
Код: Выделить всё
public class PaymentItemKey implements Serializable {
private Long id;
private Boolean active = true;
}
Код: Выделить всё
@Entity
@Table(name = "payment_item")
@IdClass(PaymentItemKey.class)
public class PaymentItemEntity {
@Id
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "payment_item_generator")
@SequenceGenerator(name = "payment_item_generator", sequenceName = "payment_item_seq", allocationSize = 1)
private Long id;
@Id
private boolean active = true;
@ManyToOne
@JoinColumns({
@JoinColumn(name = "payment_id", referencedColumnName = "id"),
@JoinColumn(name = "active", referencedColumnName = "active")
})
private PaymentEntity payment;
}
Обратите внимание: если я использую Embedded вместо IdClass, это выдаст ту же ошибку.
Подробнее здесь: https://stackoverflow.com/questions/791 ... y-and-fore