I have a one-to-many relationship between the tables, I use the @JoinColumn annotation, as I understand this annotation simply adds an extra column with an identifier to one of the tables, but I have an additional intermediate table, I would like to ask why. The first entity:
@Entity @Table(name = "TRANSACTION") public class Transaction { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column private Long TRANSACTION_ID; @ManyToOne @JoinColumn(name = "ACCOUNT_ID") private Account account; The second entity:
@Entity @Table(name = "ACCOUNT") public class Account { @Id @GeneratedValue(strategy = GenerationType.AUTO) @Column private Long ACCOUNT_ID; @OneToMany(cascade = CascadeType.ALL) List<Transaction> transactions = new ArrayList<>(); 
