I have an entity class.
@Entity
@Table(name = "Test")
public class TestEntity{
@Id
@Column(name = "test_id")
private String testId;
}
Test table does not have any primary key, but due to @Entity I had to use @Id for testId column. testId column can have duplicate values.
When I save the records in the db it gives this error.
org.hibernate.HibernateException: More than one row with the given identifier was found: 353, for class: com.abc.xyz.TestEntity
I can not add any new column as a unique identifier in the table as there are millions of records in it already in production.
Tried the below solution but all failed. @Embeddable @ManyToOne
Please help me to solve this issue.