18 package org.turro.financials.entity;
20 import java.util.Date;
21 import java.util.HashSet;
23 import javax.persistence.*;
24 import org.turro.string.Strings;
25 import org.turro.action.Contacts;
26 import org.turro.financials.model.business.IValuation;
27 import org.turro.jpa.entity.IDaoEntity;
28 import org.turro.plugin.contacts.IContact;
29 import org.turro.reflection.MappingSet;
39 @GeneratedValue(strategy=GenerationType.IDENTITY)
40 @Column(name=
"IDENTIFIER")
43 @Column(name=
"COMPANY_NAME")
46 private double structureMargin, profitMargin;
48 private boolean alwaysApply;
50 private String idContact;
52 @Temporal(value = TemporalType.DATE)
53 private Date closingDate;
55 @OneToMany(mappedBy =
"company", fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval=
true)
56 @OrderBy(value=
"name ASC")
57 private Set<Service> services =
new HashSet<Service>();
59 @OneToMany(mappedBy =
"company", fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval=
true)
60 @OrderBy(value=
"name ASC")
61 private Set<Headquarters> headquarters =
new HashSet<Headquarters>();
68 this.closingDate = closingDate;
73 return structureMargin;
77 this.structureMargin = structureMargin;
85 this.headquarters = headquarters;
102 this.idContact = idContact;
121 this.profitMargin = profitMargin;
129 this.services = services;
138 this.alwaysApply = alwaysApply;
150 return Strings.isBlank(name);
155 private transient IContact _contact;
158 if(_contact ==
null) {
166 idContact = _contact !=
null ? _contact.
getId() :
null;
167 name = _contact !=
null ? _contact.
getName() :
null;
170 private void resetIContact() {
177 MappingSet
set =
new MappingSet();
179 new String[] {
"id",
"name" },
void setStructureMargin(double structureMargin)
void setProfitMargin(double profitMargin)
Set< Service > getServices()
void setServices(Set< Service > services)
void setAlwaysApply(boolean alwaysApply)
void setIdContact(String idContact)
Set< Headquarters > getHeadquarters()
double getStructureMargin()
void setIContact(IContact contact)
void setName(String name)
MappingSet getSerializerMappings()
void setHeadquarters(Set< Headquarters > headquarters)
void setClosingDate(Date closingDate)