BrightSide Workbench Full Report + Source Code
org.turro.financials.model.contract.ContractRelations Class Reference
Inheritance diagram for org.turro.financials.model.contract.ContractRelations:
Collaboration diagram for org.turro.financials.model.contract.ContractRelations:

Public Member Functions

boolean isDirect ()
 
List< IContactRelationgetRelations (String idContact)
 
List< IContactRelationgetBusiness (String idContact)
 
List< IContactRelationgetWorkers (String idContact)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 35 of file ContractRelations.java.

Member Function Documentation

◆ getBusiness()

List<IContactRelation> org.turro.financials.model.contract.ContractRelations.getBusiness ( String  idContact)

Implements org.turro.plugin.contacts.IContactRelationSolver.

Definition at line 51 of file ContractRelations.java.

51  {
52  List<IContactRelation> list = new ArrayList<>();
53  WhereClause wc = new WhereClause();
54  wc.addClause("select cp from ContractParticipant as cp");
55  wc.addClause("where cp.idContact = :idContact");
56  wc.addNamedValue("idContact", idContact);
57  for(ContractParticipant cp : new FinancialsPU().getResultList(ContractParticipant.class, wc)) {
58  if(!cp.isEmpty()) {
59  list.add(new ContactRelationAdapter(true, cp));
60  }
61  }
62  return list;
63  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getRelations()

List<IContactRelation> org.turro.financials.model.contract.ContractRelations.getRelations ( String  idContact)

Implements org.turro.plugin.contacts.IContactRelationSolver.

Definition at line 43 of file ContractRelations.java.

43  {
44  List<IContactRelation> list = new ArrayList<>();
45  list.addAll(getBusiness(idContact));
46  list.addAll(getWorkers(idContact));
47  return list;
48  }
List< IContactRelation > getWorkers(String idContact)
List< IContactRelation > getBusiness(String idContact)
Here is the call graph for this function:

◆ getWorkers()

List<IContactRelation> org.turro.financials.model.contract.ContractRelations.getWorkers ( String  idContact)

Implements org.turro.plugin.contacts.IContactRelationSolver.

Definition at line 66 of file ContractRelations.java.

66  {
67  List<IContactRelation> list = new ArrayList<>();
68  WhereClause wc = new WhereClause();
69  wc.addClause("select cp from ContractParticipant as cp");
70  wc.addClause("where cp.contract.contractor = :idContact");
71  wc.addNamedValue("idContact", idContact);
72  for(ContractParticipant cp : new FinancialsPU().getResultList(ContractParticipant.class, wc)) {
73  if(!cp.isEmpty()) {
74  list.add(new ContactRelationAdapter(false, cp));
75  }
76  }
77  return list;
78  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isDirect()

boolean org.turro.financials.model.contract.ContractRelations.isDirect ( )

Implements org.turro.plugin.contacts.IContactRelationSolver.

Definition at line 38 of file ContractRelations.java.

38  {
39  return false;
40  }

The documentation for this class was generated from the following file: