Here is the code:
@Entity
@Table(name = "students")
public class BotUser {
...
@Id
@Column(name = "id", updatable = false)
private int id;
@OneToOne
private Equipment equipment;
...
}
@Entity
@Table(name = "students")
public class Equipment {
...
@Id
@Column(name = "id")
private int id;
...
}
When Hibernate is fetching equipment data from PostrgeSQL table, he requests "equipment_id" field, not "id". How to solve this problem?