Skip to content

Commit

Permalink
[JPA] Regen sample
Browse files Browse the repository at this point in the history
  • Loading branch information
gideruette committed Sep 13, 2024
1 parent a7c1dcf commit 9d3293e
Show file tree
Hide file tree
Showing 15 changed files with 48 additions and 149 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
@Generated("TopModel : https://github.com/klee-contrib/topmodel")
public interface ProfilController {


/**
* Ajoute un Profil.
* @param profil Profil à sauvegarder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
@Generated("TopModel : https://github.com/klee-contrib/topmodel")
public interface UtilisateurController {


/**
* Ajoute un utilisateur.
* @param utilisateur Utilisateur à sauvegarder
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import jakarta.persistence.JoinColumn;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;

import topmodel.jpa.sample.demo.enums.securite.profil.DroitCode;

Expand All @@ -31,18 +32,27 @@
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
public class Droit {

@Transient
public static final Droit CREATE = new Droit(DroitCode.CREATE);
@Transient
public static final Droit DELETE = new Droit(DroitCode.DELETE);
@Transient
public static final Droit READ = new Droit(DroitCode.READ);
@Transient
public static final Droit UPDATE = new Droit(DroitCode.UPDATE);

/**
* Code du droit.
*/
@Id
@Column(name = "DRO_CODE", nullable = false, length = 10, columnDefinition = "varchar")
@Column(name = "DRO_CODE", nullable = true, length = 10, columnDefinition = "varchar")
@Enumerated(EnumType.STRING)
private DroitCode code;

/**
* Libellé du droit.
*/
@Column(name = "DRO_LIBELLE", nullable = false, length = 100, columnDefinition = "varchar")
@Column(name = "DRO_LIBELLE", nullable = true, length = 100, columnDefinition = "varchar")
private String libelle;

/**
Expand All @@ -59,11 +69,6 @@ public Droit() {
// No arg constructor
}

public static final Droit CREATE = new Droit(DroitCode.CREATE);
public static final Droit DELETE = new Droit(DroitCode.DELETE);
public static final Droit READ = new Droit(DroitCode.READ);
public static final Droit UPDATE = new Droit(DroitCode.UPDATE);

/**
* Enum constructor.
* @param code Code dont on veut obtenir l'instance.
Expand Down Expand Up @@ -117,30 +122,6 @@ public TypeDroit getTypeDroit() {
return this.typeDroit;
}

/**
* Set the value of {@link topmodel.jpa.sample.demo.entities.securite.profil.Droit#code code}.
* @param code value to set
*/
public void setCode(DroitCode code) {
this.code = code;
}

/**
* Set the value of {@link topmodel.jpa.sample.demo.entities.securite.profil.Droit#libelle libelle}.
* @param libelle value to set
*/
public void setLibelle(String libelle) {
this.libelle = libelle;
}

/**
* Set the value of {@link topmodel.jpa.sample.demo.entities.securite.profil.Droit#typeDroit typeDroit}.
* @param typeDroit value to set
*/
public void setTypeDroit(TypeDroit typeDroit) {
this.typeDroit = typeDroit;
}

/**
* Enumération des champs de la classe {@link topmodel.jpa.sample.demo.entities.securite.profil.Droit Droit}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ public class Profil {
*/
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Id
@Column(name = "PRO_ID", nullable = false, columnDefinition = "int")
@Column(name = "PRO_ID", nullable = true, columnDefinition = "int")
private Integer id;

/**
* Libellé du profil.
*/
@Column(name = "PRO_LIBELLE", nullable = false, length = 100, columnDefinition = "varchar")
@Column(name = "PRO_LIBELLE", nullable = true, length = 100, columnDefinition = "varchar")
private String libelle;

/**
Expand All @@ -64,14 +64,14 @@ public class Profil {
/**
* Date de création de l'utilisateur.
*/
@Column(name = "PRO_DATE_CREATION", nullable = false, columnDefinition = "date")
@Column(name = "PRO_DATE_CREATION", nullable = true, columnDefinition = "date")
@CreatedDate
private LocalDateTime dateCreation = LocalDateTime.now();

/**
* Date de modification de l'utilisateur.
*/
@Column(name = "PRO_DATE_MODIFICATION", nullable = true, columnDefinition = "date")
@Column(name = "PRO_DATE_MODIFICATION", columnDefinition = "date")
@LastModifiedDate
private LocalDateTime dateModification = LocalDateTime.now();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import jakarta.persistence.EnumType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;

import topmodel.jpa.sample.demo.enums.securite.profil.TypeDroitCode;

Expand All @@ -28,18 +29,25 @@
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
public class TypeDroit {

@Transient
public static final TypeDroit ADMIN = new TypeDroit(TypeDroitCode.ADMIN);
@Transient
public static final TypeDroit READ = new TypeDroit(TypeDroitCode.READ);
@Transient
public static final TypeDroit WRITE = new TypeDroit(TypeDroitCode.WRITE);

/**
* Code du type de droit.
*/
@Id
@Column(name = "TDR_CODE", nullable = false, length = 10, columnDefinition = "varchar")
@Column(name = "TDR_CODE", nullable = true, length = 10, columnDefinition = "varchar")
@Enumerated(EnumType.STRING)
private TypeDroitCode code;

/**
* Libellé du type de droit.
*/
@Column(name = "TDR_LIBELLE", nullable = false, length = 100, columnDefinition = "varchar")
@Column(name = "TDR_LIBELLE", nullable = true, length = 100, columnDefinition = "varchar")
private String libelle;

/**
Expand All @@ -49,10 +57,6 @@ public TypeDroit() {
// No arg constructor
}

public static final TypeDroit ADMIN = new TypeDroit(TypeDroitCode.ADMIN);
public static final TypeDroit READ = new TypeDroit(TypeDroitCode.READ);
public static final TypeDroit WRITE = new TypeDroit(TypeDroitCode.WRITE);

/**
* Enum constructor.
* @param code Code dont on veut obtenir l'instance.
Expand Down Expand Up @@ -90,22 +94,6 @@ public String getLibelle() {
return this.libelle;
}

/**
* Set the value of {@link topmodel.jpa.sample.demo.entities.securite.profil.TypeDroit#code code}.
* @param code value to set
*/
public void setCode(TypeDroitCode code) {
this.code = code;
}

/**
* Set the value of {@link topmodel.jpa.sample.demo.entities.securite.profil.TypeDroit#libelle libelle}.
* @param libelle value to set
*/
public void setLibelle(String libelle) {
this.libelle = libelle;
}

/**
* Enumération des champs de la classe {@link topmodel.jpa.sample.demo.entities.securite.profil.TypeDroit TypeDroit}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import jakarta.persistence.EnumType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.persistence.Transient;

import topmodel.jpa.sample.demo.enums.securite.utilisateur.TypeUtilisateurCode;

Expand All @@ -28,18 +29,25 @@
@Cache(usage = CacheConcurrencyStrategy.READ_ONLY)
public class TypeUtilisateur {

@Transient
public static final TypeUtilisateur ADMIN = new TypeUtilisateur(TypeUtilisateurCode.ADMIN);
@Transient
public static final TypeUtilisateur CLIENT = new TypeUtilisateur(TypeUtilisateurCode.CLIENT);
@Transient
public static final TypeUtilisateur GEST = new TypeUtilisateur(TypeUtilisateurCode.GEST);

/**
* Code du type d'utilisateur.
*/
@Id
@Column(name = "TUT_CODE", nullable = false, length = 10, columnDefinition = "varchar")
@Column(name = "TUT_CODE", nullable = true, length = 10, columnDefinition = "varchar")
@Enumerated(EnumType.STRING)
private TypeUtilisateurCode code;

/**
* Libellé du type d'utilisateur.
*/
@Column(name = "TUT_LIBELLE", nullable = false, length = 100, columnDefinition = "varchar")
@Column(name = "TUT_LIBELLE", nullable = true, length = 100, columnDefinition = "varchar")
private String libelle;

/**
Expand All @@ -49,10 +57,6 @@ public TypeUtilisateur() {
// No arg constructor
}

public static final TypeUtilisateur ADMIN = new TypeUtilisateur(TypeUtilisateurCode.ADMIN);
public static final TypeUtilisateur CLIENT = new TypeUtilisateur(TypeUtilisateurCode.CLIENT);
public static final TypeUtilisateur GEST = new TypeUtilisateur(TypeUtilisateurCode.GEST);

/**
* Enum constructor.
* @param code Code dont on veut obtenir l'instance.
Expand Down Expand Up @@ -90,22 +94,6 @@ public String getLibelle() {
return this.libelle;
}

/**
* Set the value of {@link topmodel.jpa.sample.demo.entities.securite.utilisateur.TypeUtilisateur#code code}.
* @param code value to set
*/
public void setCode(TypeUtilisateurCode code) {
this.code = code;
}

/**
* Set the value of {@link topmodel.jpa.sample.demo.entities.securite.utilisateur.TypeUtilisateur#libelle libelle}.
* @param libelle value to set
*/
public void setLibelle(String libelle) {
this.libelle = libelle;
}

/**
* Enumération des champs de la classe {@link topmodel.jpa.sample.demo.entities.securite.utilisateur.TypeUtilisateur TypeUtilisateur}.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,43 +42,43 @@ public class Utilisateur {
*/
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Id
@Column(name = "UTI_ID", nullable = false, columnDefinition = "int")
@Column(name = "UTI_ID", nullable = true, columnDefinition = "int")
private Integer id;

/**
* Nom de l'utilisateur.
*/
@Column(name = "UTI_NOM", nullable = false, length = 100, columnDefinition = "varchar")
@Column(name = "UTI_NOM", nullable = true, length = 100, columnDefinition = "varchar")
private String nom;

/**
* Nom de l'utilisateur.
*/
@Column(name = "UTI_PRENOM", nullable = false, length = 100, columnDefinition = "varchar")
@Column(name = "UTI_PRENOM", nullable = true, length = 100, columnDefinition = "varchar")
private String prenom;

/**
* Email de l'utilisateur.
*/
@Column(name = "UTI_EMAIL", nullable = false, length = 50, columnDefinition = "varchar")
@Column(name = "UTI_EMAIL", nullable = true, length = 50, columnDefinition = "varchar")
private String email;

/**
* Age de l'utilisateur.
*/
@Column(name = "UTI_DATE_NAISSANCE", nullable = true, columnDefinition = "date")
@Column(name = "UTI_DATE_NAISSANCE", columnDefinition = "date")
private LocalDate dateNaissance;

/**
* Adresse de l'utilisateur.
*/
@Column(name = "UTI_ADRESSE", nullable = true, length = 100, columnDefinition = "varchar")
@Column(name = "UTI_ADRESSE", length = 100, columnDefinition = "varchar")
private String adresse;

/**
* Si l'utilisateur est actif.
*/
@Column(name = "UTI_ACTIF", nullable = false, columnDefinition = "boolean")
@Column(name = "UTI_ACTIF", nullable = true, columnDefinition = "boolean")
private Boolean actif = true;

/**
Expand All @@ -98,14 +98,14 @@ public class Utilisateur {
/**
* Date de création de l'utilisateur.
*/
@Column(name = "UTI_DATE_CREATION", nullable = false, columnDefinition = "date")
@Column(name = "UTI_DATE_CREATION", nullable = true, columnDefinition = "date")
@CreatedDate
private LocalDateTime dateCreation = LocalDateTime.now();

/**
* Date de modification de l'utilisateur.
*/
@Column(name = "UTI_DATE_MODIFICATION", nullable = true, columnDefinition = "date")
@Column(name = "UTI_DATE_MODIFICATION", columnDefinition = "date")
@LastModifiedDate
private LocalDateTime dateModification = LocalDateTime.now();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ public enum DroitCode {
/**
* Mise à jour.
*/
UPDATE;
UPDATE
}
Loading

0 comments on commit 9d3293e

Please sign in to comment.