f221920a19
Issue gh-3746
121 lines
2.4 KiB
Java
Executable File
121 lines
2.4 KiB
Java
Executable File
/*
|
|
* Copyright 2002-2016 the original author or authors.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
|
|
package sample.domain;
|
|
|
|
import java.io.Serializable;
|
|
import java.util.Date;
|
|
|
|
import javax.persistence.Basic;
|
|
import javax.persistence.Entity;
|
|
import javax.persistence.GeneratedValue;
|
|
import javax.persistence.GenerationType;
|
|
import javax.persistence.Id;
|
|
import javax.persistence.NamedQuery;
|
|
|
|
/**
|
|
* The Class Patient.
|
|
*/
|
|
@Entity
|
|
@NamedQuery(name = "User.findByUsername", query = "from User where username= :username")
|
|
public class User implements Serializable {
|
|
|
|
/** serialVersionUID */
|
|
private static final long serialVersionUID = 7073017148588882593L;
|
|
|
|
/** The id. */
|
|
@Id
|
|
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
|
private Long id;
|
|
|
|
/** The username. */
|
|
@Basic(optional = false)
|
|
private String username;
|
|
|
|
/** The username. */
|
|
@Basic(optional = false)
|
|
private String password;
|
|
|
|
/**
|
|
* Default constructor
|
|
*/
|
|
public User() {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* @param username
|
|
* @param password
|
|
*/
|
|
public User(String username, String password) {
|
|
super();
|
|
this.username = username;
|
|
this.password = password;
|
|
}
|
|
|
|
/**
|
|
* @return the id
|
|
*/
|
|
public Long getId() {
|
|
return id;
|
|
}
|
|
|
|
/**
|
|
* @param id the id to set
|
|
*/
|
|
public void setId(Long id) {
|
|
this.id = id;
|
|
}
|
|
|
|
/**
|
|
* @return the username
|
|
*/
|
|
public String getUsername() {
|
|
return username;
|
|
}
|
|
|
|
/**
|
|
* @param username the username to set
|
|
*/
|
|
public void setUsername(String username) {
|
|
this.username = username;
|
|
}
|
|
|
|
/**
|
|
* Full constructor
|
|
* @param username
|
|
*/
|
|
public User(String username, String password, Date derniereConnexion,
|
|
String key) {
|
|
super();
|
|
this.username = username;
|
|
}
|
|
|
|
/**
|
|
* @return the password
|
|
*/
|
|
public String getPassword() {
|
|
return password;
|
|
}
|
|
|
|
/**
|
|
* @param password the password to set
|
|
*/
|
|
public void setPassword(String password) {
|
|
this.password = password;
|
|
}
|
|
}
|