I have a table which is of kind Ledger which records all information with no unique values.
Name | Date | Statement |
---|---|---|
First | row | random data |
Second | row | random data |
I am trying to create an Entity which will only fetch name and statement
@Entity
public class MyTable {
private String name;
private String statement;
}
As I am not specifing @Id I am getting exception and We don't have any unique identifier in the table I can't mention @Id annotation.
Also, If we need to write any user defined method for getting these values please suggest how to do that as well.Any sources or samples will greatly help here.