18 package org.turro.financials.entity;
20 import java.util.HashSet;
22 import javax.persistence.*;
23 import org.turro.string.Strings;
24 import org.turro.action.Contacts;
25 import org.turro.financials.model.business.IValuation;
26 import org.turro.jpa.entity.IDaoEntity;
27 import org.turro.plugin.contacts.IContact;
37 @Column(name=
"IDENTIFIER")
38 @GeneratedValue(strategy=GenerationType.IDENTITY)
41 @Column(name=
"HEADQUARTERS_NAME")
44 private double structureMargin, profitMargin;
46 private boolean alwaysApply;
48 private String idContact;
53 @OneToMany(mappedBy =
"headquarters", fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval=
true)
54 @OrderBy(value=
"name ASC")
55 private Set<Department> departments =
new HashSet<Department>();
62 this.company = company;
70 this.departments = departments;
75 return structureMargin;
79 this.structureMargin = structureMargin;
96 this.idContact = idContact;
115 this.profitMargin = profitMargin;
124 this.alwaysApply = alwaysApply;
136 return Strings.isBlank(name) || Strings.isBlank(idContact);
141 private transient IContact _contact;
144 if(_contact ==
null) {
152 idContact = _contact !=
null ? _contact.
getId() :
null;
153 name = _contact !=
null ? _contact.
getName() :
null;
156 private void resetIContact() {
double getStructureMargin()
void setIContact(IContact contact)
void setName(String name)
void setStructureMargin(double structureMargin)
void setCompany(Company company)
void setIdContact(String idContact)
Set< Department > getDepartments()
void setAlwaysApply(boolean alwaysApply)
void setDepartments(Set< Department > departments)
void setProfitMargin(double profitMargin)