Ajout table profil
This commit is contained in:
parent
7b53f48521
commit
b0044d6200
40
src/main/java/com/covas/Entity/ProfilEntity.java
Normal file
40
src/main/java/com/covas/Entity/ProfilEntity.java
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
package com.covas.Entity;
|
||||||
|
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.LocalDateTime;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
import javax.persistence.Column;
|
||||||
|
import javax.persistence.Entity;
|
||||||
|
import javax.persistence.GeneratedValue;
|
||||||
|
import javax.persistence.Id;
|
||||||
|
import javax.persistence.NamedQueries;
|
||||||
|
import javax.persistence.NamedQuery;
|
||||||
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
|
import javax.persistence.JoinColumn;
|
||||||
|
import javax.persistence.CascadeType;
|
||||||
|
|
||||||
|
import com.covas.Classes.Hash;
|
||||||
|
|
||||||
|
import org.hibernate.annotations.ColumnDefault;
|
||||||
|
import org.hibernate.annotations.GenericGenerator;
|
||||||
|
import io.quarkus.hibernate.orm.panache.PanacheEntityBase;
|
||||||
|
|
||||||
|
|
||||||
|
@Entity
|
||||||
|
@Table(name = "profile")
|
||||||
|
public class ProfilEntity extends PanacheEntityBase {
|
||||||
|
@Id
|
||||||
|
@Column(name = "id")
|
||||||
|
@GeneratedValue(generator = "UUID")
|
||||||
|
@GenericGenerator(name = "UUID", strategy = "org.hibernate.id.UUIDGenerator")
|
||||||
|
public UUID id;
|
||||||
|
|
||||||
|
@Column(columnDefinition="TEXT")
|
||||||
|
public String description;
|
||||||
|
|
||||||
|
@OneToOne(cascade = CascadeType.ALL)
|
||||||
|
@JoinColumn(name = "users_id", referencedColumnName = "id")
|
||||||
|
public UsersEntity users;
|
||||||
|
}
|
@ -11,6 +11,7 @@ import javax.persistence.Id;
|
|||||||
import javax.persistence.NamedQueries;
|
import javax.persistence.NamedQueries;
|
||||||
import javax.persistence.NamedQuery;
|
import javax.persistence.NamedQuery;
|
||||||
import javax.persistence.Table;
|
import javax.persistence.Table;
|
||||||
|
import javax.persistence.OneToOne;
|
||||||
|
|
||||||
import com.covas.Classes.Hash;
|
import com.covas.Classes.Hash;
|
||||||
|
|
||||||
@ -69,6 +70,9 @@ public class UsersEntity extends PanacheEntityBase {
|
|||||||
@ColumnDefault("null")
|
@ColumnDefault("null")
|
||||||
public LocalDateTime connected_at;
|
public LocalDateTime connected_at;
|
||||||
|
|
||||||
|
@OneToOne(mappedBy = "users")
|
||||||
|
public ProfilEntity profile;
|
||||||
|
|
||||||
public static UsersEntity findByPseudo(String pseudo){
|
public static UsersEntity findByPseudo(String pseudo){
|
||||||
return find("pseudo", pseudo).firstResult();
|
return find("pseudo", pseudo).firstResult();
|
||||||
}
|
}
|
||||||
|
@ -10,8 +10,8 @@ quarkus.datasource.username = ${POSTGRES_USER:default}
|
|||||||
quarkus.datasource.password = ${POSTGRES_PASSWORD:default}
|
quarkus.datasource.password = ${POSTGRES_PASSWORD:default}
|
||||||
quarkus.datasource.jdbc.url = jdbc:postgresql://${POSTGRES_URL:localhost}:${POSTGRES_PORT:5432}/${POSTGRES_DB:default}
|
quarkus.datasource.jdbc.url = jdbc:postgresql://${POSTGRES_URL:localhost}:${POSTGRES_PORT:5432}/${POSTGRES_DB:default}
|
||||||
# drop and create the database at startup (use `update` to only update the schema)
|
# drop and create the database at startup (use `update` to only update the schema)
|
||||||
#quarkus.hibernate-orm.database.generation = drop-and-create
|
quarkus.hibernate-orm.database.generation = drop-and-create
|
||||||
quarkus.hibernate-orm.database.generation = update
|
#quarkus.hibernate-orm.database.generation = update
|
||||||
covas.schema.create = true
|
covas.schema.create = true
|
||||||
|
|
||||||
quarkus.mailer.auth-methods=DIGEST-MD5 CRAM-SHA256 CRAM-SHA1 CRAM-MD5 PLAIN LOGIN
|
quarkus.mailer.auth-methods=DIGEST-MD5 CRAM-SHA256 CRAM-SHA1 CRAM-MD5 PLAIN LOGIN
|
||||||
|
Loading…
x
Reference in New Issue
Block a user