You must implement the connection between the document header and the document table.
I created two entities the document and document line and configured ACC. connection. I'm interested in whether correct architecture? Or there is a standard variant of implementation of this decision.
@Entity
@Table
public class Document extends BaseEntity {
@Column
@Temporal(TemporalType.DATE)
private Date Date;
@Column
@Temporal(TemporalType.DATE)
private Date createDate;
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private Set<documentrow> rows;
...
}
public class DocumentRow extends BaseEntity {
@ManyToOne(optional = false, cascade = CascadeType.ALL)
private Document document;
@Column(nullable = false, unique = true)
private Integer row;
...
}</documentrow>