Searching DB registers by other field instead PK using JPA
I have a project using JPA without any framework. I want to search registers by others fields like 'username', 'password' instead the primary key. I need to use SQL with JPA to it?
I tried to create the same method in my JPA controller class using a string instead to the id for the search, obviously this give me a error where I see that the method search a numeric PK. But I can't to do something similar?
I tried to create the same method in my JPA controller class using a string instead to the id for the search, obviously this give me a error where I see that the method search a numeric PK. But I can't to do something similar?