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

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 ContractRelationSolver.java.

Member Function Documentation

◆ getBusiness()

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

Implements org.turro.plugin.contacts.IContactRelationSolver.

Definition at line 51 of file ContractRelationSolver.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.ContractRelationSolver.getRelations ( String  idContact)

Implements org.turro.plugin.contacts.IContactRelationSolver.

Definition at line 43 of file ContractRelationSolver.java.

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

◆ getWorkers()

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

Implements org.turro.plugin.contacts.IContactRelationSolver.

Definition at line 66 of file ContractRelationSolver.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.ContractRelationSolver.isDirect ( )

Implements org.turro.plugin.contacts.IContactRelationSolver.

Definition at line 38 of file ContractRelationSolver.java.

38  {
39  return false;
40  }

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