BrightSide Workbench Full Report + Source Code
org.turro.contacts.util.MostUsed Class Reference

Static Public Member Functions

static String getConnector (String choices, String defaultChoice)
 
static String getAddress (String choices, String defaultChoice)
 

Detailed Description

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

Definition at line 29 of file MostUsed.java.

Member Function Documentation

◆ getAddress()

static String org.turro.contacts.util.MostUsed.getAddress ( String  choices,
String  defaultChoice 
)
static

Definition at line 43 of file MostUsed.java.

43  {
44  Dao dao = new ContactsPU();
45  WhereClause wc = new WhereClause();
46  wc.addClause("select address.description, count(address.description)");
47  wc.addClause("from Address address");
48  wc.addClause("where address.description in (" + SQLHelper.quoteTokensForIn(choices) + ")");
49  wc.addClause("group by address.description");
50  wc.addClause("order by count(address.description) DESC");
51  Object o[] = (Object[]) dao.getSingleResult(wc);
52  return (String) ((o == null || o.length == 0 || o[0] == null) ? defaultChoice : o[0]);
53  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getConnector()

static String org.turro.contacts.util.MostUsed.getConnector ( String  choices,
String  defaultChoice 
)
static

Definition at line 31 of file MostUsed.java.

31  {
32  Dao dao = new ContactsPU();
33  WhereClause wc = new WhereClause();
34  wc.addClause("select connector.description, count(connector.description)");
35  wc.addClause("from Connector connector");
36  wc.addClause("where connector.description in (" + SQLHelper.quoteTokensForIn(choices) + ")");
37  wc.addClause("group by connector.description");
38  wc.addClause("order by count(connector.description) DESC");
39  Object o[] = (Object[]) dao.getSingleResult(wc);
40  return (String) ((o == null || o.length == 0 || o[0] == null) ? defaultChoice : o[0]);
41  }
Here is the call graph for this function:
Here is the caller graph for this function:

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