public interface ZoneSequenceRepository extends org.springframework.data.repository.PagingAndSortingRepository<ZoneSequence,java.util.UUID>
Modifier and Type | Method and Description |
---|---|
void |
deactivateAllContainingZoneNumber(java.util.UUID areaId,
int zoneNumber)
Sets all zone sequences of certain area that contain a zone with certain number to inactive
|
void |
deleteAllContainingZoneNumber(java.util.UUID areaId,
int zoneNumber)
Deletes all zone sequences of certain area that contain a zone with certain number
|
java.util.Optional<ZoneSequence> |
findByAreaIdAndZoneNumbers(java.util.UUID areaId,
int[] zoneNumbers)
Finds ZoneSequence based on ID of the monitored area it belongs to and the zone numbers
it is made of
|
@Query(value="select zs from ZoneSequence zs join fetch zs.area where zs.area.id = ?1 and zs.zoneNumbers = ?2") java.util.Optional<ZoneSequence> findByAreaIdAndZoneNumbers(java.util.UUID areaId, int[] zoneNumbers)
areaId
- the ID of the monitored areazoneNumbers
- the vector of zone numbers@Modifying @Query(nativeQuery=true, value="delete from zone_sequences where monitored_area_id = ?1 and ?2 = any(zone_numbers)") void deleteAllContainingZoneNumber(java.util.UUID areaId, int zoneNumber)
areaId
- the ID of the area whose sequences should be to deletedzoneNumber
- the zone number that deleted zone sequences must contain@Modifying @Query(nativeQuery=true, value="update zone_sequences set active = \'f\' where monitored_area_id = ?1 and ?2 = any(zone_numbers)") void deactivateAllContainingZoneNumber(java.util.UUID areaId, int zoneNumber)
areaId
- the ID of the area whose sequences should be to deletedzoneNumber
- the zone number that deleted zone sequences must contain