spring hibernate many-to-one relationship. When transmitting data from the front end to the background, why pass the attribute .id of the foreign key, such as logo.id? if you do not pass logo.id like this, but logo,spring in this way, you will get an error .
I have used Google query, but I don"t have the answer I want. Is it related to the design of spring
related codes
- javabean part of the code is as follows:
public class ProductCategory extends BaseObj {
/**
*
*/
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "logo_id")
private Picture logo;
}
- the correct code that the front end transmits to the background, because name = logo.id:
<tr>
<td>:</td>
<td>
<div class="clearfix">
<input v-model="modalData.logo["id"]" name="logo.id"/>
</td>
</tr>
- error code transferred from the front end to the background, because name = logo:
<tr>
<td>:</td>
<td>
<div class="clearfix">
<input v-model="modalData.logo["id"]" name="logo"/>
</td>
</tr>
I would like to fundamentally explain why it is necessary to have an attribute id, otherwise an error will be reported. Kneel and thank the gods