Last change
on this file was baf4cc4, checked in by ppaunovski <paunovskipavel@…>, 3 months ago |
split group project and individual project into two separate folders
|
-
Property mode
set to
100644
|
File size:
1010 bytes
|
Line | |
---|
1 | package mk.ukim.finki.busngobackend.service
|
---|
2 |
|
---|
3 | import org.springframework.jdbc.core.JdbcTemplate
|
---|
4 | import org.springframework.stereotype.Service
|
---|
5 | import org.springframework.transaction.annotation.Transactional
|
---|
6 |
|
---|
7 | @Service
|
---|
8 | class MaterializedViewService(
|
---|
9 | private val jdbcTemplate: JdbcTemplate,
|
---|
10 | ) {
|
---|
11 | @Transactional
|
---|
12 | fun refreshAverageTimeDiffs() {
|
---|
13 | val sql = "REFRESH MATERIALIZED VIEW CONCURRENTLY project.avg_time_diffs;"
|
---|
14 | jdbcTemplate.execute(sql)
|
---|
15 | }
|
---|
16 |
|
---|
17 | @Transactional
|
---|
18 | fun refreshCommutesByHour() {
|
---|
19 | val sql = "refresh materialized view concurrently project.most_busy_part_of_the_day;"
|
---|
20 | jdbcTemplate.execute(sql)
|
---|
21 | }
|
---|
22 |
|
---|
23 | @Transactional
|
---|
24 | fun refreshFinesPerLine() {
|
---|
25 | val sql = "refresh materialized view concurrently project.kazna_po_linija;"
|
---|
26 | jdbcTemplate.execute(sql)
|
---|
27 | }
|
---|
28 |
|
---|
29 | @Transactional
|
---|
30 | fun refreshTotalIncome() {
|
---|
31 | val sql = "refresh materialized view concurrently project.total_income;"
|
---|
32 | jdbcTemplate.execute(sql)
|
---|
33 | }
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.