'Spring boot does not insert on Joincolumn

I have two tables

  1. ListA
  2. ListB

ListB has @joinColumn on ListA.

When I post a request on ListB I don't want ListA to insert a new column on its own column. Instead, I want ListB to join the column point to ListA id because I am doing a search on it (findByIdName). I Using mapsId and modelmapper (DTO).

Can someone help me understand how to achieve this.

@OneToOne(fetch=FetchType.LAZY, cascade=CascadeType.ALL, 
mappedBy="listA", optional = false)
@JsonIgnore
private ListB listB;

@JoinColumn(name = "listA_id")
@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private ListA listA;


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source