|
static String | getConnector (String choices, String defaultChoice) |
|
static String | getAddress (String choices, String defaultChoice) |
|
- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 29 of file MostUsed.java.
◆ getAddress()
static String org.turro.contacts.util.MostUsed.getAddress |
( |
String |
choices, |
|
|
String |
defaultChoice |
|
) |
| |
|
static |
Definition at line 43 of file MostUsed.java.
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]);
◆ getConnector()
static String org.turro.contacts.util.MostUsed.getConnector |
( |
String |
choices, |
|
|
String |
defaultChoice |
|
) |
| |
|
static |
Definition at line 31 of file MostUsed.java.
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]);
The documentation for this class was generated from the following file: