BrightSide Workbench Full Report + Source Code
org.turro.activity.ContractParticipationCatcher Class Reference
Inheritance diagram for org.turro.activity.ContractParticipationCatcher:
Collaboration diagram for org.turro.activity.ContractParticipationCatcher:

Public Member Functions

String getDescription ()
 
Dao createDao ()
 
WhereClause getQuery (Path entityPath)
 
boolean getCanDelete (Contract v)
 
String getDescription (Contract v)
 
void doDelete (Contract v)
 
void doShow (Contract v)
 
void onChange (Object entity)
 
void onDelete (Object entity)
 
boolean getCanChangeFor (Contract v)
 
void doChangeFor (Contract v, Path toPath)
 
Object getReferringEntity (Contract v)
 
- Public Member Functions inherited from org.turro.activity.JpaParticipationCatcher< Contract >
List< IParticipationgetParticipations (Path entityPath)
 
Dao getDao ()
 
abstract Dao createDao ()
 
abstract WhereClause getQuery (Path entityPath)
 
abstract boolean getCanDelete (V v)
 
abstract boolean getCanChangeFor (V v)
 
abstract String getDescription (V v)
 
abstract void doDelete (V v)
 
abstract void doShow (V v)
 
abstract void doChangeFor (V v, Path toPath)
 
abstract Object getReferringEntity (V v)
 

Detailed Description

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

Definition at line 35 of file ContractParticipationCatcher.java.

Member Function Documentation

◆ createDao()

Dao org.turro.activity.ContractParticipationCatcher.createDao ( )

Definition at line 43 of file ContractParticipationCatcher.java.

43  {
44  return new FinancialsPU();
45  }

◆ doChangeFor()

void org.turro.activity.ContractParticipationCatcher.doChangeFor ( Contract  v,
Path  toPath 
)

Definition at line 114 of file ContractParticipationCatcher.java.

114  {
115  // do nothing
116  }

◆ doDelete()

void org.turro.activity.ContractParticipationCatcher.doDelete ( Contract  v)

Definition at line 74 of file ContractParticipationCatcher.java.

Here is the call graph for this function:

◆ doShow()

void org.turro.activity.ContractParticipationCatcher.doShow ( Contract  v)

Definition at line 79 of file ContractParticipationCatcher.java.

79  {
80  FinancialsMenu.showContract(v.getId());
81  }
Here is the call graph for this function:

◆ getCanChangeFor()

boolean org.turro.activity.ContractParticipationCatcher.getCanChangeFor ( Contract  v)

Definition at line 109 of file ContractParticipationCatcher.java.

109  {
110  return false;
111  }

◆ getCanDelete()

boolean org.turro.activity.ContractParticipationCatcher.getCanDelete ( Contract  v)

Definition at line 64 of file ContractParticipationCatcher.java.

64  {
65  return false;
66  }

◆ getDescription() [1/2]

String org.turro.activity.ContractParticipationCatcher.getDescription ( )

Definition at line 38 of file ContractParticipationCatcher.java.

38  {
39  return "BrightSide Financials - " + I_.get("Contract");
40  }
Here is the call graph for this function:

◆ getDescription() [2/2]

String org.turro.activity.ContractParticipationCatcher.getDescription ( Contract  v)

Definition at line 69 of file ContractParticipationCatcher.java.

69  {
70  return v.getName();
71  }
Here is the call graph for this function:

◆ getQuery()

WhereClause org.turro.activity.ContractParticipationCatcher.getQuery ( Path  entityPath)

Definition at line 48 of file ContractParticipationCatcher.java.

48  {
49  if(!entityPath.isRoot() && "contact".equals(entityPath.getRoot())) {
50  WhereClause wc = new WhereClause();
51  wc.addClause("select distinct contract from Contract as contract");
52  wc.addClause("left join contract.participants as participant");
53  wc.addClause("where contract.contractor = :id");
54  wc.addNamedValue("id", entityPath.getLastNode());
55  wc.addClause("or participant.idContact = :id2");
56  wc.addNamedValue("id2", entityPath.getLastNode());
57  wc.addClause("order by contract.id");
58  return wc;
59  }
60  return null;
61  }
Here is the call graph for this function:

◆ getReferringEntity()

Object org.turro.activity.ContractParticipationCatcher.getReferringEntity ( Contract  v)

Definition at line 119 of file ContractParticipationCatcher.java.

119  {
120  return v;
121  }

◆ onChange()

void org.turro.activity.ContractParticipationCatcher.onChange ( Object  entity)

Definition at line 84 of file ContractParticipationCatcher.java.

84  {
85  if(entity instanceof IContact) {
86  IContact contact = (IContact) entity;
87  List<Contract> contracts = getDao().getResultList(
88  "select c from Contract c where c.contractor = ?",
89  new Object[] { contact.getId() });
90  for(Contract contract : contracts) {
92  "update Contract set name = ? " +
93  "where id = ?",
94  new Object[] { contract.getFullDescription(), contract.getId() });
95  }
97  "update ContractParticipant set name = ? " +
98  "where idContact = ?",
99  new Object[] { contact.getName(), contact.getId() });
100  }
101  }
int executeUpdate(String query)
Definition: Dao.java:463
Here is the call graph for this function:

◆ onDelete()

void org.turro.activity.ContractParticipationCatcher.onDelete ( Object  entity)

Definition at line 104 of file ContractParticipationCatcher.java.

104  {
105  // do nothing
106  }

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