16 package emlab.gen.repository;
18 import org.springframework.data.neo4j.annotation.Query;
19 import org.springframework.data.neo4j.annotation.QueryType;
20 import org.springframework.data.neo4j.repository.GraphRepository;
29 GraphRepository<DecarbonizationAgent> {
31 @Query(value =
"agents = g.idx('__types__')[[className:'emlab.gen.domain.agent.DecarbonizationAgent']];"
33 +
"for(agent in agents){if(agent.co2Allowances!=null) co2Allowances+=agent.co2Allowances};"
34 +
"return co2Allowances;", type = QueryType.Gremlin)
35 double determineTotallyBankedCO2Certificates();
37 @Query(value =
"agents = g.idx('__types__')[[className:'emlab.gen.domain.agent.DecarbonizationAgent']];"
39 +
"for(agent in agents){if(agent.lastYearsCo2Allowances!=null) co2Allowances+=agent.lastYearsCo2Allowances};"
40 +
"return co2Allowances;", type = QueryType.Gremlin)
41 double determinePreviouslyBankedCO2Certificates();