Advertisement
Guest User

Untitled

a guest
Feb 27th, 2017
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.30 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package javaapplication4;
  7.  
  8. import java.io.Serializable;
  9. import java.util.Date;
  10. import javax.persistence.Entity;
  11. import javax.persistence.GeneratedValue;
  12. import javax.persistence.GenerationType;
  13. import javax.persistence.Id;
  14. import javax.persistence.Temporal;
  15.  
  16. /**
  17.  *
  18.  * @author xmrva
  19.  */
  20. @Entity
  21. public class osoba implements Serializable {
  22.  
  23.     private static final long serialVersionUID = 1L;
  24.     @Id
  25.     @GeneratedValue(strategy = GenerationType.AUTO)
  26.     private Long id;
  27.    
  28.     private String meno;
  29.     @Temporal(javax.persistence.TemporalType.DATE)
  30.     private Date narodenia;
  31.     private float vyska;
  32.     private float vaha;
  33.  
  34.     public void setMeno(String meno) {
  35.         this.meno = meno;
  36.     }
  37.  
  38.     public void setNarodenia(Date narodenia) {
  39.         this.narodenia = narodenia;
  40.     }
  41.  
  42.     public void setVyska(float vyska) {
  43.         this.vyska = vyska;
  44.     }
  45.  
  46.     public void setVaha(float vaha) {
  47.         this.vaha = vaha;
  48.     }
  49.  
  50.     public static long getSerialVersionUID() {
  51.         return serialVersionUID;
  52.     }
  53.  
  54.     public String getMeno() {
  55.         return meno;
  56.     }
  57.  
  58.     public Date getNarodenia() {
  59.         return narodenia;
  60.     }
  61.  
  62.     public float getVyska() {
  63.         return vyska;
  64.     }
  65.  
  66.     public float getVaha() {
  67.         return vaha;
  68.     }
  69.  
  70.     public Long getId() {
  71.         return id;
  72.     }
  73.  
  74.     public void setId(Long id) {
  75.         this.id = id;
  76.     }
  77.  
  78.     @Override
  79.     public int hashCode() {
  80.         int hash = 0;
  81.         hash += (id != null ? id.hashCode() : 0);
  82.         return hash;
  83.     }
  84.  
  85.     @Override
  86.     public boolean equals(Object object) {
  87.         // TODO: Warning - this method won't work in the case the id fields are not set
  88.         if (!(object instanceof osoba)) {
  89.             return false;
  90.         }
  91.         osoba other = (osoba) object;
  92.         if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
  93.             return false;
  94.         }
  95.         return true;
  96.     }
  97.  
  98.     @Override
  99.     public String toString() {
  100.         return "javaapplication4.osoba[ id=" + id + " ]";
  101.     }
  102.    
  103. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement