Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package warstwa_biznesowa.entity;
- import java.io.Serializable;
- import javax.persistence.Entity;
- import javax.persistence.GeneratedValue;
- import javax.persistence.GenerationType;
- import javax.persistence.Id;
- @Entity
- public class Produkt1 implements Serializable {
- private static final long serialVersionUID = 1L;
- @Id
- @GeneratedValue(strategy = GenerationType.AUTO)
- private Long id;
- private String nazwa_producenta;
- private String nazwa;
- private float cena;
- private int promocja;
- public String getNazwa_producenta() {
- return nazwa_producenta;
- }
- public void setNazwa_producenta(String nazwa_producenta) {
- this.nazwa_producenta = nazwa_producenta;
- }
- public String getNazwa() {
- return nazwa;
- }
- public void setNazwa(String nazwa) {
- this.nazwa = nazwa;
- }
- public float getCena() {
- return cena;
- }
- public void setCena(float cena) {
- this.cena = cena;
- }
- public int getPromocja() {
- return promocja;
- }
- public void setPromocja(int promocja) {
- this.promocja = promocja;
- }
- public float cena_brutto ()
- {
- float cena_brutto= cena*(1-(float)promocja/100);
- return cena_brutto;
- }
- public Long getId() {
- return id;
- }
- public void setId(Long id) {
- this.id = id;
- }
- @Override
- public int hashCode() {
- int hash = 0;
- hash += (id != null ? id.hashCode() : 0);
- return hash;
- }
- @Override
- public boolean equals(Object object) {
- // TODO: Warning - this method won't work in the case the id fields are not set
- if (!(object instanceof Produkt1)) {
- return false;
- }
- Produkt1 other = (Produkt1) object;
- if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
- return false;
- }
- return true;
- }
- @Override
- public String toString() {
- return "warstwa_biznesowa.entity.Produkt1[ id=" + id + " ]";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement