I'm trying to connect the Play's yabe tutorial with Postgres.
When i try to login as a particular user to post something in the Yabe app,
I get this following error,
JPAQueryException occured : Error while executing query from models.User where email = ? AND password = ?: ERROR: column user0_.id does not exist Position: 8
My User Model class is as below,
@Email
@Required
public String email;
@Required
public String password;
public String fullname;
public boolean isAdmin;
public User(String email, String password, String fullname) {
this.email = email;
this.password = password;
this.fullname = fullname;
}
public static User connect(String email, String password) {
return find("byEmailAndPassword", email, password).first();
//return find("Select u from User u where u.email = ? and u.password = ?", email, password).first();
}
public String toString(){
return email;
}
}`
I get this error in the connect method's "return find("byEmailAndPassword", email, password).first();" line.
I created the table in Postgres using the following query,
create table "User" ( id SERIAL, email varchar(255) NOT NULL, password varchar(255) NOT NULL, fullname varchar(255) NOT NULL, isAdmin boolean NOT NULL, primary key(id) );
I'm new to this framework and mvc style, and have no idea as to what the error is. Can anyone guide me as what should be done to fix this?
Thanks