Im trying to do a simple search for two columns for a table.
My customer entity class snipet:
@Entity
@Table(name = "CUSTOMER")
public class Customer {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "CUSTOMER_ID", nullable = false)
private int customer_id;
@Column(name = "FIRST_NAME", nullable = false)
private String first_name;
@Column(name = "LAST_NAME", nullable = false)
private String last_name;
@Column(name = "PHONE_NUMBER", nullable = false)
private String phone_number;
@Column(name = "EMAIL")
private String email;
my customerRepository class snipet:
@Repository
public interface CustomerRepository extends JpaRepository<Customer, Integer> {
List<Customer> findAllByFirst_nameAndLast_name(String firstName, String lastname);
}
When compiling and running springBoot i get this error:
nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List com.owl.owlserver.repositories.CustomerRepository.findAllByFirst_nameAndLast_name(java.lang.String,java.lang.String)! No property first found for type Customer!
So its not able to detect the fields in the customer object, should I be importing the customer class into the repository somehow?
