BrightSide Workbench Full Report + Source Code
org.turro.alliance.provider.ProjectGrantProvider Class Reference
Inheritance diagram for org.turro.alliance.provider.ProjectGrantProvider:
Collaboration diagram for org.turro.alliance.provider.ProjectGrantProvider:

Public Member Functions

 ProjectGrantProvider (WsMember member, String reason, Jsons criteria)
 

Protected Member Functions

Jsons loadData (WsMember member, String reason, Jsons criteria)
 
long count (WsMember member, String reason, Jsons criteria)
 

Detailed Description

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

Definition at line 35 of file ProjectGrantProvider.java.

Constructor & Destructor Documentation

◆ ProjectGrantProvider()

org.turro.alliance.provider.ProjectGrantProvider.ProjectGrantProvider ( WsMember  member,
String  reason,
Jsons  criteria 
)

Definition at line 37 of file ProjectGrantProvider.java.

37  {
38  super(member, reason, criteria);
39  }

Member Function Documentation

◆ count()

long org.turro.alliance.provider.ProjectGrantProvider.count ( WsMember  member,
String  reason,
Jsons  criteria 
)
protected

Definition at line 63 of file ProjectGrantProvider.java.

63  {
64  String search = criteria.getString("search", "");
65  boolean notSelf = criteria.getBoolean("notSelf", false);
66  return SqlClause.select("count(p)").from("AxProjectGrant p")
67  .startIf(!Strings.isBlank(search))
68  .whereOrAnd().partial(search, "p.title")
69  .endIf()
70  .startIf(notSelf)
71  .whereOrAnd().notEqual("projectGrantId.memberId", member.getMemberId())
72  .endIf()
73  .dao(dao.get())
74  .singleResult(Long.class, 0L);
75  }
Here is the call graph for this function:

◆ loadData()

Jsons org.turro.alliance.provider.ProjectGrantProvider.loadData ( WsMember  member,
String  reason,
Jsons  criteria 
)
protected

Definition at line 42 of file ProjectGrantProvider.java.

42  {
43  Jsons projectGrants = Jsons.array();
44  String search = criteria.getString("search", "");
45  boolean notSelf = criteria.getBoolean("notSelf", false);
46  SqlClause.select("p").from("AxProjectGrant p")
47  .startIf(!Strings.isBlank(search))
48  .whereOrAnd().partial(search, "p.title")
49  .endIf()
50  .startIf(notSelf)
51  .whereOrAnd().notEqual("projectGrantId.memberId", member.getMemberId())
52  .endIf()
53  .orderBy("p.endDate desc")
54  .start(criteria.getInt("curr", -1)).max(criteria.getInt("page", -1))
55  .dao(dao.get())
56  .resultList(AxProjectGrant.class).forEach(projectGrant -> {
57  projectGrants.addValue(Jsons.read(projectGrant.toJson()));
58  });
59  return projectGrants;
60  }
Here is the call graph for this function:

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