BrightSide Workbench Full Report + Source Code
org.turro.assistant.EntityParticipationUtils Class Reference

Static Public Member Functions

static EntityParticipation addParticipation (String participatorPath, String entityPath, ParticipationReason reason)
 
static EntityParticipation addParticipation (Dao dao, String participatorPath, String entityPath, ParticipationReason reason)
 
static EntityParticipation getParticipation (String participatorPath, String entityPath, ParticipationReason reason)
 
static EntityParticipation getParticipation (Dao dao, String participatorPath, String entityPath, ParticipationReason reason)
 

Detailed Description

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

Definition at line 33 of file EntityParticipationUtils.java.

Member Function Documentation

◆ addParticipation() [1/2]

static EntityParticipation org.turro.assistant.EntityParticipationUtils.addParticipation ( Dao  dao,
String  participatorPath,
String  entityPath,
ParticipationReason  reason 
)
static

Definition at line 39 of file EntityParticipationUtils.java.

39  {
40  EntityParticipation ea = getParticipation(dao, participatorPath, entityPath, reason);
41  if(ea == null) {
42  ea = new EntityParticipation();
43  ea.setParticipatorPath(participatorPath);
44  ea.setEntityPath(entityPath);
45  ea.setReason(reason);
46  ea.setParticipationDate(new Date());
47  return dao.saveObject(ea);
48  } else {
49  return ea;
50  }
51  }
static EntityParticipation getParticipation(String participatorPath, String entityPath, ParticipationReason reason)
Here is the call graph for this function:

◆ addParticipation() [2/2]

static EntityParticipation org.turro.assistant.EntityParticipationUtils.addParticipation ( String  participatorPath,
String  entityPath,
ParticipationReason  reason 
)
static

Definition at line 35 of file EntityParticipationUtils.java.

35  {
36  return addParticipation(new ElephantPU(), participatorPath, entityPath, reason);
37  }
static EntityParticipation addParticipation(String participatorPath, String entityPath, ParticipationReason reason)

◆ getParticipation() [1/2]

static EntityParticipation org.turro.assistant.EntityParticipationUtils.getParticipation ( Dao  dao,
String  participatorPath,
String  entityPath,
ParticipationReason  reason 
)
static

Definition at line 57 of file EntityParticipationUtils.java.

57  {
58  WhereClause wc = new WhereClause();
59  wc.addClause("select ep from EntityParticipation ep");
60  wc.addClause("where ep.participatorPath = :participatorPath");
61  wc.addNamedValue("participatorPath", participatorPath);
62  wc.addClause("and ep.entityPath = :entityPath");
63  wc.addNamedValue("entityPath", entityPath);
64  wc.addClause("and ep.reason = :reason");
65  wc.addNamedValue("reason", reason);
66  return (EntityParticipation) dao.getSingleResultOrNull(wc);
67  }
Here is the call graph for this function:

◆ getParticipation() [2/2]

static EntityParticipation org.turro.assistant.EntityParticipationUtils.getParticipation ( String  participatorPath,
String  entityPath,
ParticipationReason  reason 
)
static

Definition at line 53 of file EntityParticipationUtils.java.

53  {
54  return getParticipation(new ElephantPU(), participatorPath, entityPath, reason);
55  }
Here is the caller graph for this function:

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