Re-organisation des packages
This commit is contained in:
40
src/main/java/com/covas/Entity/UsersEntity.java
Normal file
40
src/main/java/com/covas/Entity/UsersEntity.java
Normal file
@@ -0,0 +1,40 @@
|
||||
package com.covas.Entity;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Table;
|
||||
|
||||
import com.covas.Enums.Roles;
|
||||
|
||||
import org.hibernate.annotations.ColumnDefault;
|
||||
|
||||
import io.quarkus.hibernate.orm.panache.PanacheEntity;
|
||||
|
||||
@Entity
|
||||
@Table(name = "users")
|
||||
public class UsersEntity extends PanacheEntity {
|
||||
|
||||
@Column(nullable = false, unique = true)
|
||||
public String pseudo;
|
||||
@Column(nullable = false, unique = true)
|
||||
public String email;
|
||||
@Column(nullable = false)
|
||||
public String name;
|
||||
@Column(nullable = false)
|
||||
public String firstName;
|
||||
@Column(nullable = false)
|
||||
public LocalDate birth;
|
||||
@ColumnDefault("false")
|
||||
public Boolean status;
|
||||
@Column(nullable = false)
|
||||
public String password;
|
||||
|
||||
public Roles roles;
|
||||
|
||||
public static UsersEntity findByPseudo(String pseudo){
|
||||
return find("pseudo", pseudo).firstResult();
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user