BrightSide Workbench Full Report + Source Code
ProductByContractor.java
Go to the documentation of this file.
1 /*
2  * TurrĂ³ i Cutiller Foundation. License notice.
3  * Copyright (C) 2011 Lluis TurrĂ³ Cutiller <http://www.turro.org/>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU Affero General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU Affero General Public License for more details.
14  *
15  * You should have received a copy of the GNU Affero General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 package org.turro.financials.entity;
19 
20 import javax.persistence.*;
21 import org.turro.string.Strings;
22 
27 @Entity
28 public class ProductByContractor implements java.io.Serializable {
29 
30  @Id
31  @GeneratedValue(strategy=GenerationType.IDENTITY)
32  @Column(name="IDENTIFIER")
33  private long id;
34 
35  @ManyToOne
36  private Contract contract;
37 
38  @ManyToOne
39  private Product product;
40 
41  private String contractorCode;
42 
43  private String description;
44 
45  private double price;
46 
47  private double tax;
48 
49  public Contract getContract() {
50  return contract;
51  }
52 
53  public void setContract(Contract contract) {
54  this.contract = contract;
55  }
56 
57  public String getContractorCode() {
58  return contractorCode;
59  }
60 
61  public void setContractorCode(String contractorCode) {
62  this.contractorCode = contractorCode;
63  }
64 
65  public String getDescription() {
66  return description;
67  }
68 
69  public void setDescription(String description) {
70  this.description = description;
71  }
72 
73  public long getId() {
74  return id;
75  }
76 
77  public void setId(long id) {
78  this.id = id;
79  }
80 
81  public double getPrice() {
82  return price;
83  }
84 
85  public void setPrice(double price) {
86  this.price = price;
87  }
88 
89  public Product getProduct() {
90  return product;
91  }
92 
93  public void setProduct(Product product) {
94  this.product = product;
95  }
96 
97  public double getTax() {
98  return tax;
99  }
100 
101  public void setTax(double tax) {
102  this.tax = tax;
103  }
104 
105  /* Helpers */
106 
107  public boolean isEmpty() {
108  return contract == null || product == null || Strings.isBlank(contractorCode);
109  }
110 
111 }