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.elephant.db.IdUtils;
25 import org.turro.financials.db.FinancialsPU;
26 import org.turro.jpa.entity.IDaoEntity;
27 import org.turro.reflection.MappingSet;
37 @GeneratedValue(strategy=GenerationType.IDENTITY)
38 @Column(name=
"IDENTIFIER")
41 @Column(name=
"ASSET_NAME")
44 private double depreciated;
45 private double investment;
47 private boolean unsubscribed;
49 @OneToMany(mappedBy=
"fixedAsset",fetch=FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval=
true)
50 @OrderBy(
"depreciationDate")
51 private Set<FixedAssetDepreciation> depreciations =
new HashSet<FixedAssetDepreciation>();
53 @OneToMany(fetch=FetchType.EAGER)
54 private Set<DocumentLine> documentLines =
new HashSet<DocumentLine>();
60 private LineType depreciationLineType;
77 this.depreciated = depreciated;
81 return depreciationLineType;
85 this.depreciationLineType = depreciationLineType;
93 this.depreciations = depreciations;
101 this.documentLines = documentLines;
117 this.investment = investment;
121 return investmentPreference;
125 this.investmentPreference = investmentPreference;
157 this.unsubscribed = unsubscribed;
177 return Strings.isBlank(name) || view ==
null || store ==
null ||
178 investmentPreference ==
null || depreciationLineType ==
null;
192 MappingSet
set =
new MappingSet();
194 new String[] {
"name",
"depreciated",
"investment" },
195 new String[] {
"depreciations",
"investmentPreference",
196 "depreciationLineType",
"view",
"store",
"notes" });
198 new String[] {
"id",
"name" },
201 new String[] {
"id",
"name" },
204 new String[] {
"id",
"name" },
207 new String[] {
"depreciationDate",
"percent",
"comment" },
210 new String[] {
"name" },
static long getNewLongIdFromLong(Dao dao, String table, String field)
void setInvestmentPreference(ContractPreference investmentPreference)
LineType getDepreciationLineType()
void setDepreciated(double depreciated)
void setDocumentLines(Set< DocumentLine > documentLines)
void setDepreciations(Set< FixedAssetDepreciation > depreciations)
void setName(String name)
void setStore(Contract store)
Set< FixedAssetDepreciation > getDepreciations()
void setView(RegisterView view)
MappingSet getSerializerMappings()
Set< DocumentLine > getDocumentLines()
ContractPreference getInvestmentPreference()
void setDepreciationLineType(LineType depreciationLineType)
void setInvestment(double investment)
void setNotes(String notes)
void setUnsubscribed(boolean unsubscribed)