I am new to spring boot and StackOverflow as well. So kindly ignore any mistakes.
Actually, I want to access and print the data in a table using Spring JPA or Spring Data, let say the table has 100 columns, and I want to print only 2 columns let's say id and name. Do I have to create all the 100 fields in my model? Is there any way that I could connect to it by making a model with id and name variables only?
For example, there is a product table, let's say on the redshift database on aws, the table name is Product and it has 200 columns. I am creating a rest API where I need just 2 things, id and name to be shown. something like:
@Entity("Product")
class Product {
@Id private Long id;
private String name;
}
but when I do this I get the exception of: Schema not found
Is it necessary to specially all the 200 fields in this class Product?