16 package emlab.gen.repository;
18 import java.util.List;
20 import org.springframework.data.neo4j.annotation.Query;
21 import org.springframework.data.neo4j.annotation.QueryType;
22 import org.springframework.data.neo4j.repository.GraphRepository;
23 import org.springframework.data.repository.query.Param;
24 import org.springframework.stereotype.Repository;
51 @Query(value =
"start market=node:__types__(\"className:emlab.gen.domain.market.electricity.ElectricitySpotMarket\") return market")
54 @Query(value =
"g.idx('__types__')[[className:'emlab.gen.domain.market.electricity.ElectricitySpotMarket']].toList()", type = QueryType.Gremlin)
55 public List<ElectricitySpotMarket> findAllElectricitySpotMarketsAsList();
57 @Query(value =
"start market=node:__types__(\"className:emlab.gen.domain.market.electricity.ElectricitySpotMarket\") return count(market)")
58 double countAllElectricitySpotMarkets();
65 @Query(value =
"g.idx('__types__')[[className:'emlab.gen.domain.market.CO2Auction']].next()", type = QueryType.Gremlin)
75 @Query(value =
"g.v(zone).in('ZONE').filter{it.__type__=='emlab.gen.domain.market.electricity.ElectricitySpotMarket'}.next()", type = QueryType.Gremlin)
78 @Query(value =
"START nationalG = node({nationalG}), electricityMarket = node:__types__(\"className:emlab.gen.domain.market.electricity.ElectricitySpotMarket\") MATCH (nationalG)-[:GOVERNED_ZONE]->(zone)<-[:ZONE]-(electricityMarket) RETURN electricityMarket")
81 @Query(value =
"g.v(plant).out('LOCATION').out('REGION').in('ZONE').filter{it.__type__=='emlab.gen.domain.market.electricity.ElectricitySpotMarket'}.next()", type = QueryType.Gremlin)
84 @Query(value =
"segID = g.v(segment).segmentID;"
85 +
"return g.v(zone).in('ZONE').filter{it.__type__=='emlab.gen.domain.market.electricity.ElectricitySpotMarket'}.out('SEGMENT_LOAD').as('SL').out('SEGMENTLOAD_SEGMENT').filter{it.segmentID==segID}.back('SL').next();", type = QueryType.Gremlin)
86 public SegmentLoad findSegmentLoadForElectricitySpotMarketForZone(@Param(
"zone")
Zone zone, @Param(
"segment")
Segment segment);
95 @Query(value =
"g.v(substance).in('SUBSTANCE_MARKET').next()", type = QueryType.Gremlin)
DecarbonizationMarket findFirstMarketBySubstance(@Param("substance") Substance substance)
CO2Auction findCO2Auction()
ElectricitySpotMarket findElectricitySpotMarketForZone(@Param("zone") Zone zone)
Iterable< ElectricitySpotMarket > findAllElectricitySpotMarkets()