Skip to content
Snippets Groups Projects
Commit 4c918f03 authored by Mirco Nasuti's avatar Mirco Nasuti
Browse files

Trying to add some caching

parent 326db99c
No related branches found
No related tags found
No related merge requests found
......@@ -6,8 +6,10 @@ package eu.hbp.mip;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cache.annotation.EnableCaching;
@SpringBootApplication
@EnableCaching
public class MIPApplication {
public static void main(String[] args) {
......
......@@ -2,6 +2,7 @@ package eu.hbp.mip.utils;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.jdbc.core.JdbcTemplate;
import java.util.List;
......@@ -22,6 +23,7 @@ public class DataUtil {
this.jdbcTemplate = jdbcTemplate;
}
@Cacheable("varsdata")
public JsonObject getDataFromVariables(List<String> vars)
{
JsonObject data = new JsonObject();
......@@ -48,6 +50,7 @@ public class DataUtil {
return data;
}
@Cacheable("colscount")
public long countVariables()
{
long count = jdbcTemplate.queryForObject(
......@@ -56,6 +59,7 @@ public class DataUtil {
return count;
}
@Cacheable("rowscount")
public long countAdniRows()
{
long count = jdbcTemplate.queryForObject(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment