I have a class configuration something like the following(just a sample not actual meaning) -
public class payment
{
@Id
@Column("payment_id")
private int paymentId;
@ManyToOne
@JoinColumn(name ="")
private Fine fine;
//getter setter and other stuff
}
public class Fine{
@Id
@Column("fine_id")
private int fineId;
@Column("amount")
private int fineAmount;
//other stuff
}
I am getting org.hibernate.ObjectNotFoundException: No row with the given identifier exists
error message. In accordance with the answer it is because a foreign key cannot have null
value but my db contains null
. I cant change the db or project structure so is there any way so that i can issue null
value to my foreign key 'legally' ie without creating an exception.