// Path: bxbot-ui-server-rest-api/src/main/java/com/gazbert/bxbot/ui/server/rest/security/model/User.java
// @Entity
// @Table(name = "USER")
// public class User {
// 
//     @Id
//     @Column(name = "ID")
//     @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "user_seq")
//     @SequenceGenerator(name = "user_seq", sequenceName = "user_seq", allocationSize = 1)
//     private Long id;
// 
//     @Column(name = "USERNAME", length = 50, unique = true)
//     @NotNull
//     @Size(min = 4, max = 50)
//     private String username;
// 
//     @Column(name = "PASSWORD", length = 100)
//     @NotNull
//     @Size(min = 4, max = 100)
//     private String password;
// 
//     @Column(name = "FIRSTNAME", length = 50)
//     @NotNull
//     @Size(min = 4, max = 50)
//     private String firstname;
// 
//     @Column(name = "LASTNAME", length = 50)
//     @NotNull
//     @Size(min = 4, max = 50)
//     private String lastname;
// 
//     @Column(name = "EMAIL", length = 50)
//     @NotNull
//     @Size(min = 4, max = 50)
//     private String email;
// 
//     @Column(name = "ENABLED")
//     @NotNull
//     private Boolean enabled;
// 
//     @Column(name = "LASTPASSWORDRESETDATE")
//     @Temporal(TemporalType.TIMESTAMP)
//     @NotNull
//     private Date lastPasswordResetDate;
// 
//     @ManyToMany(fetch = FetchType.EAGER)
//     @JoinTable(
//             name = "USER_ROLE",
//             joinColumns = {@JoinColumn(name = "USER_ID", referencedColumnName = "ID")},
//             inverseJoinColumns = {@JoinColumn(name = "ROLE_ID", referencedColumnName = "ID")})
//     private List<Role> roles;
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public String getUsername() {
//         return username;
//     }
// 
//     public void setUsername(String username) {
//         this.username = username;
//     }
// 
//     public String getPassword() {
//         return password;
//     }
// 
//     public void setPassword(String password) {
//         this.password = password;
//     }
// 
//     public String getFirstname() {
//         return firstname;
//     }
// 
//     public void setFirstname(String firstname) {
//         this.firstname = firstname;
//     }
// 
//     public String getLastname() {
//         return lastname;
//     }
// 
//     public void setLastname(String lastname) {
//         this.lastname = lastname;
//     }
// 
//     public String getEmail() {
//         return email;
//     }
// 
//     public void setEmail(String email) {
//         this.email = email;
//     }
// 
//     public Boolean getEnabled() {
//         return enabled;
//     }
// 
//     public void setEnabled(Boolean enabled) {
//         this.enabled = enabled;
//     }
// 
//     public List<Role> getRoles() {
//         return roles;
//     }
// 
//     public void setRoles(List<Role> roles) {
//         this.roles = roles;
//     }
// 
//     public Date getLastPasswordResetDate() {
//         if (lastPasswordResetDate != null) {
//             return new Date(lastPasswordResetDate.getTime());
//         } else {
//             return null;
//         }
//     }
// 
//     public void setLastPasswordResetDate(Date lastPasswordResetDate) {
//         Assert.notNull(lastPasswordResetDate, "lastPasswordResetDate cannot be null!");
//         this.lastPasswordResetDate = new Date(lastPasswordResetDate.getTime());
//     }
// }


import com.gazbert.bxbot.ui.server.rest.security.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2016 Stephan Zerhusen
 * Copyright (c) 2017 Gareth Jon Lynch
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 * the Software, and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.gazbert.bxbot.ui.server.rest.security.repository;


/**
 * JPA repository for looking up User details.
 * <p>
 * Code originated from the excellent JWT and Spring Boot example by Stephan Zerhusen:
 * https://github.com/szerhusenBC/jwt-spring-security-demo
 *
 * @author gazbert
 */
@RepositoryRestResource(exported = false)
public interface UserRepository extends JpaRepository<User, Long> {
// Path: bxbot-ui-server-rest-api/src/main/java/com/gazbert/bxbot/ui/server/rest/security/model/User.java
// @Entity
// @Table(name = "USER")
// public class User {
// 
//     @Id
//     @Column(name = "ID")
//     @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "user_seq")
//     @SequenceGenerator(name = "user_seq", sequenceName = "user_seq", allocationSize = 1)
//     private Long id;
// 
//     @Column(name = "USERNAME", length = 50, unique = true)
//     @NotNull
//     @Size(min = 4, max = 50)
//     private String username;
// 
//     @Column(name = "PASSWORD", length = 100)
//     @NotNull
//     @Size(min = 4, max = 100)
//     private String password;
// 
//     @Column(name = "FIRSTNAME", length = 50)
//     @NotNull
//     @Size(min = 4, max = 50)
//     private String firstname;
// 
//     @Column(name = "LASTNAME", length = 50)
//     @NotNull
//     @Size(min = 4, max = 50)
//     private String lastname;
// 
//     @Column(name = "EMAIL", length = 50)
//     @NotNull
//     @Size(min = 4, max = 50)
//     private String email;
// 
//     @Column(name = "ENABLED")
//     @NotNull
//     private Boolean enabled;
// 
//     @Column(name = "LASTPASSWORDRESETDATE")
//     @Temporal(TemporalType.TIMESTAMP)
//     @NotNull
//     private Date lastPasswordResetDate;
// 
//     @ManyToMany(fetch = FetchType.EAGER)
//     @JoinTable(
//             name = "USER_ROLE",
//             joinColumns = {@JoinColumn(name = "USER_ID", referencedColumnName = "ID")},
//             inverseJoinColumns = {@JoinColumn(name = "ROLE_ID", referencedColumnName = "ID")})
//     private List<Role> roles;
// 
//     public Long getId() {
//         return id;
//     }
// 
//     public void setId(Long id) {
//         this.id = id;
//     }
// 
//     public String getUsername() {
//         return username;
//     }
// 
//     public void setUsername(String username) {
//         this.username = username;
//     }
// 
//     public String getPassword() {
//         return password;
//     }
// 
//     public void setPassword(String password) {
//         this.password = password;
//     }
// 
//     public String getFirstname() {
//         return firstname;
//     }
// 
//     public void setFirstname(String firstname) {
//         this.firstname = firstname;
//     }
// 
//     public String getLastname() {
//         return lastname;
//     }
// 
//     public void setLastname(String lastname) {
//         this.lastname = lastname;
//     }
// 
//     public String getEmail() {
//         return email;
//     }
// 
//     public void setEmail(String email) {
//         this.email = email;
//     }
// 
//     public Boolean getEnabled() {
//         return enabled;
//     }
// 
//     public void setEnabled(Boolean enabled) {
//         this.enabled = enabled;
//     }
// 
//     public List<Role> getRoles() {
//         return roles;
//     }
// 
//     public void setRoles(List<Role> roles) {
//         this.roles = roles;
//     }
// 
//     public Date getLastPasswordResetDate() {
//         if (lastPasswordResetDate != null) {
//             return new Date(lastPasswordResetDate.getTime());
//         } else {
//             return null;
//         }
//     }
// 
//     public void setLastPasswordResetDate(Date lastPasswordResetDate) {
//         Assert.notNull(lastPasswordResetDate, "lastPasswordResetDate cannot be null!");
//         this.lastPasswordResetDate = new Date(lastPasswordResetDate.getTime());
//     }
// }


// Path: bxbot-ui-server-rest-api/src/main/java/com/gazbert/bxbot/ui/server/rest/security/repository/UserRepository.java
import com.gazbert.bxbot.ui.server.rest.security.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;

/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2016 Stephan Zerhusen
 * Copyright (c) 2017 Gareth Jon Lynch
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 * the Software, and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

package com.gazbert.bxbot.ui.server.rest.security.repository;


/**
 * JPA repository for looking up User details.
 * <p>
 * Code originated from the excellent JWT and Spring Boot example by Stephan Zerhusen:
 * https://github.com/szerhusenBC/jwt-spring-security-demo
 *
 * @author gazbert
 */
@RepositoryRestResource(exported = false)
public interface UserRepository extends JpaRepository<User, Long> {
    User findByUsername(String username);