i am developing an application using spring boot and postgreSql. I am getting the following error while executing select query using where clause

I am doing this in my repository.I am trying to fetch the user details using his email id by using native query:

public class RegistrationRepository {
    EntityManager em;

     private Logger logger=LoggerFactory.getLogger(this.getClass());

     public UserDetailsEntity getUserDetails(String emailId) {
        Query query=em.createNativeQuery("select * from 
      UserDetailsEntity where userEmail=:userEmail",UserDetailsEntity.class);
        query.setParameter("userEmail", emailId);
        List result=query.getResultList();
        return null;

Entity class is given below:

package com.counselor.entities;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

public class UserDetailsEntity {

    private Long userId;

    private String userEmail;

    private String password;

    private String phoneNumber;

    private LocalDateTime lastUpdatedDate;

    private LocalDateTime createdDate;

    private List<RegistrationDetails> listofSubmittedProposals=new ArrayList<>();

    //getters and setters   

I am getting this error on console

org.postgresql.util.PSQLException: ERROR: relation "userdetailsentity" does not exist
  Position: 15

0 Answers