package fr.cnam.test;

import javax.persistence.*;

@Entity
  @Table(name="personnes")
  public class Personne
  {
    @Id
      @GeneratedValue
      private Integer id;

    @Column
      private String nom;

    @Column
      private String prenom;

    @Column
      private Integer age;

    public Personne()
    {
      id=0;
      nom="";
      prenom="";
      age=0;
    }

    public Personne(String nom,String prenom,Integer age)
    {
      this.nom=nom;
      this.prenom=prenom;
      this.age=age;
    }
  
    public String toString() {
      return String.format("%2d %15s %15s %2d",id,nom,prenom,age);
    }

    public Integer getId(){return id;}
    public String getNom(){return nom;}
    public String getPrenom(){return prenom;}
    public Integer getAge(){return age;}
    
    public void setId(Integer id){this.id=id;}
    public void setNom(String nom){this.nom=nom;}
    public void setPrenom(String prenom){this.prenom=prenom;}
    public void setAge(Integer age){this.age=age;}

  }
        