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

Public Member Functions

 PreferencesProvider (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 36 of file PreferencesProvider.java.

Constructor & Destructor Documentation

◆ PreferencesProvider()

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

Definition at line 38 of file PreferencesProvider.java.

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

Member Function Documentation

◆ count()

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

Definition at line 56 of file PreferencesProvider.java.

56  {
57  List<Long> ids = criteria.getArrayValues("categoryIds", Long.class);
58  String search = criteria.getString("search", "");
59  int phase = criteria.getInt("phase", -1);
60  return SqlClause.select("count(p)").from("AxProject p")
61  .startIf(ids != null && !ids.isEmpty())
62  .where().in("categoryId", ids)
63  .endIf()
64  .startIf(!Strings.isBlank(search))
65  .whereOrAnd().partial(search, "p.code", "p.name", "p.summary")
66  .endIf()
67  .startIf(phase > -1)
68  .whereOrAnd().equal("p.phaseIndex", phase)
69  .endIf()
70  .dao(dao.get())
71  .singleResult(Long.class, 0L);
72  }

◆ loadData()

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

Definition at line 43 of file PreferencesProvider.java.

43  {
44  AxMemberPreferences preferences = SqlClause.select("p").from("AxMemberPreferences p")
45  .where().equal("memberId", member.getMemberId())
46  .dao(dao.get())
47  .singleResult(AxMemberPreferences.class, null);
48  if(preferences == null) {
49  preferences = new AxMemberPreferences();
50  preferences.setMemberId(member.getMemberId());
51  }
52  return Jsons.read(preferences.toJson());
53  }
Here is the call graph for this function:

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