- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 31 of file UsualUsages.java.
◆ addUsage()
static Usually org.turro.usual.UsualUsages.addUsage |
( |
String |
path | ) |
|
|
static |
Definition at line 33 of file UsualUsages.java.
34 if(!Strings.isBlank(path)) {
35 if(path.length() > 255) {
36 path = path.substring(0, 255);
38 if(path.endsWith(
":null")) {
39 path = path.substring(0, path.length() - 4);
41 Dao dao =
new ContactsPU();
44 u = (Usually) dao.getSingleResult(
45 "select u from Usually as u " +
50 u.setUsages(u.getUsages() + 1L);
51 u = dao.saveObject(u);
52 }
catch(NoResultException ex) {
56 u = dao.saveObject(u);
◆ clearUsuals()
static void org.turro.usual.UsualUsages.clearUsuals |
( |
String |
path | ) |
|
|
static |
Definition at line 116 of file UsualUsages.java.
117 if(!Strings.isBlank(path)) {
118 if(path.length() > 255) {
119 path = path.substring(0, 255);
121 Dao dao =
new ContactsPU();
123 "delete from Usually " +
◆ getMostUsed()
static Usually org.turro.usual.UsualUsages.getMostUsed |
( |
String |
path | ) |
|
|
static |
Definition at line 86 of file UsualUsages.java.
87 if(!Strings.isBlank(path)) {
88 if(path.length() > 255) {
89 path = path.substring(0, 255);
91 Dao dao =
new ContactsPU();
93 List<Usually> l = dao.getResultList(
94 "select u from Usually as u " +
95 "where u.path like ? " +
97 " select max(u2.usages) from Usually as u2 " +
98 " where u2.path like ? " +
101 path +
"%", path +
"%"
106 }
catch(NoResultException ex) {}
◆ getMostUsedvalue()
static String org.turro.usual.UsualUsages.getMostUsedvalue |
( |
String |
path | ) |
|
|
static |
Definition at line 111 of file UsualUsages.java.
113 return u ==
null ? null : u.getPath().substring(path.length());
static Usually getMostUsed(String path)
◆ getUsage()
static Usually org.turro.usual.UsualUsages.getUsage |
( |
String |
path | ) |
|
|
static |
Definition at line 63 of file UsualUsages.java.
64 if(!Strings.isBlank(path)) {
65 if(path.length() > 255) {
66 path = path.substring(0, 255);
68 Dao dao =
new ContactsPU();
70 return (Usually) dao.getSingleResult(
71 "select u from Usually as u " +
76 }
catch(NoResultException ex) {}
◆ getUsageCount()
static long org.turro.usual.UsualUsages.getUsageCount |
( |
String |
path | ) |
|
|
static |
Definition at line 81 of file UsualUsages.java.
83 return u ==
null ? 0 : u.getUsages();
static Usually getUsage(String path)
The documentation for this class was generated from the following file: