◆ cleanup()
void org.turro.log.SystemLogModel.cleanup |
( |
String |
entityPath | ) |
|
Definition at line 58 of file SystemLogModel.java.
59 SqlClause.delete(
"SystemLog")
61 .equal(
"entityPath", entityPath)
62 .or().startsWith(
"entityPath", entityPath +
"/")
64 .and().notIn(
"comment", List.of(
"cleanup",
"deleted"))
◆ firstEntry()
SystemLog org.turro.log.SystemLogModel.firstEntry |
( |
String |
entityPath, |
|
|
String |
comment |
|
) |
| |
Definition at line 83 of file SystemLogModel.java.
84 return SqlClause.select(
"l").from(
"SystemLog l")
85 .where().equal(
"l.comment", comment)
86 .and().equal(
"l.entityPath", entityPath)
87 .and(
"l.dateLog =").sub(
88 SqlClause.select(
"min(l2.dateLog)").from(
"SystemLog l2")
89 .where(
"l2.comment = l.comment")
90 .and(
"l2.entityPath = l.entityPath")
91 .groupBy(
"l2.comment, l2.entityPath"))
93 .singleResult(SystemLog.class);
◆ getAllPaths()
static Set<String> org.turro.log.SystemLogModel.getAllPaths |
( |
String |
root | ) |
|
|
static |
Definition at line 71 of file SystemLogModel.java.
72 try(Stream<String> stream = SqlClause.select(
"distinct entityPath").from(
"SystemLog")
73 .where().startsWith(
"entityPath",
"/" + root +
"/")
74 .and().notIn(
"comment", List.of(
"cleanup",
"deleted"))
75 .dao(
new ElephantPU())
76 .stream(String.class)) {
77 return new HashSet<>(stream.map(path -> Path.pathFrom(path).getTill(2)).toList());
◆ getCountOf()
long org.turro.log.SystemLogModel.getCountOf |
( |
String |
comment, |
|
|
String |
entityPath, |
|
|
Date |
since |
|
) |
| |
Definition at line 40 of file SystemLogModel.java.
41 return Optional.ofNullable(
42 SqlClause.select(
"sum(counts)").from(
"SystemLog")
44 .startIf(!Strings.isBlank(comment))
45 .and().equal(
"comment", comment)
47 .startIf(!Strings.isBlank(entityPath))
48 .and().equal(
"entityPath", entityPath)
50 .startIf(since !=
null)
51 .and().greaterOrEqual(
"dateLog", since)
54 .singleResult(Long.class))
◆ lastEntry()
SystemLog org.turro.log.SystemLogModel.lastEntry |
( |
String |
entityPath, |
|
|
String |
comment |
|
) |
| |
Definition at line 96 of file SystemLogModel.java.
97 return SqlClause.select(
"l").from(
"SystemLog l")
98 .where().equal(
"l.comment", comment)
99 .and().equal(
"l.entityPath", entityPath)
100 .and(
"l.dateLog =").sub(
101 SqlClause.select(
"max(l2.dateLog)").from(
"SystemLog l2")
102 .where(
"l2.comment = l.comment")
103 .and(
"l2.entityPath = l.entityPath")
104 .groupBy(
"l2.comment, l2.entityPath"))
106 .singleResult(SystemLog.class);
The documentation for this class was generated from the following file: