package models;

import java.io.Serializable;

import javax.persistence.*;


import java.util.Date;
import java.sql.Timestamp;
import java.util.List;


/**
 * The persistent class for the users database table.
 * 
 */
@Entity
@Table(name="users")
@NamedQuery(name="User.findAll", query="SELECT u FROM User u")
public class User implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private int id;

	@Column(name="activation_key")
	private String activationKey;

	private boolean active;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name="creation_date")
	private Date creationDate;

	private String email;

	@Column(name="last_update")
	private Timestamp lastUpdate;

	private String password;

	@Column(name="picture_path")
	private String picturePath;

	//bi-directional many-to-one association to Reminder
	@OneToMany(mappedBy="user", fetch=FetchType.LAZY)
	private List<Reminder> reminders;

	public User() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getActivationKey() {
		return this.activationKey;
	}

	public void setActivationKey(String activationKey) {
		this.activationKey = activationKey;
	}

	public boolean getActive() {
		return this.active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public Date getCreationDate() {
		return this.creationDate;
	}

	public void setCreationDate(Date creationDate) {
		this.creationDate = creationDate;
	}

	public String getEmail() {
		return this.email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Timestamp getLastUpdate() {
		return this.lastUpdate;
	}

	public void setLastUpdate(Timestamp lastUpdate) {
		this.lastUpdate = lastUpdate;
	}

	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getPicturePath() {
		return this.picturePath;
	}

	public void setPicturePath(String picturePath) {
		this.picturePath = picturePath;
	}

	public List<Reminder> getReminders() {
		return this.reminders;
	}

	public void setReminders(List<Reminder> reminders) {
		this.reminders = reminders;
	}

	public Reminder addReminder(Reminder reminder) {
		getReminders().add(reminder);
		reminder.setUser(this);

		return reminder;
	}

	public Reminder removeReminder(Reminder reminder) {
		getReminders().remove(reminder);
		reminder.setUser(null);

		return reminder;
	}

}
@@ -240,16 +240,46 @@
 users%22)%0A
+@NamedQueries%0A(%0A    %7B%0A        
 @NamedQu
@@ -332,16 +332,165 @@
 User u%22)
+,%0A        @NamedQuery(name = %22User.findByEmailAndPassword%22, query = %22SELECT u FROM User u WHERE u.email = :email AND u.password = :password%22)%0A    %7D%0A)
 %0Apublic 

Add User.findByEmailAndPassword named query to User model