18 package org.turro.erp.entity;
20 import java.util.Collection;
21 import javax.persistence.*;
22 import org.turro.string.Strings;
23 import org.turro.elephant.util.DecimalFormats;
24 import org.turro.util.CompareUtil;
34 @GeneratedValue(strategy= GenerationType.IDENTITY)
35 @Column(name=
"IDENTIFIER")
45 private double cost, price, marketPrice;
68 this.marketPrice = marketPrice;
84 this.aptitude = aptitude;
92 this.ordering = ordering;
106 return Strings.isBlank(name) || (ordering == 0 && (cost == 0.0 || price == 0.0));
109 public boolean isIn(Collection<AptitudeDegree> aptitudeDegrees) {
111 if(CompareUtil.compare(name, o.getName()) == 0 &&
112 ordering <= o.ordering) {
120 return aptitude.getName() +
121 (!Strings.isEmpty(name) ?
" " + name :
"");
void setCost(double cost)
void setMarketPrice(double marketPrice)
boolean isIn(Collection< AptitudeDegree > aptitudeDegrees)
void setAptitude(Aptitude aptitude)
void setOrdering(int ordering)
void setPrice(double price)
void setName(String name)
String getFullDescription()