Interface WaveformRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Waveform,Long>, DetachableJpaRepository<Waveform,Long>, org.springframework.data.jpa.repository.JpaRepository<Waveform,Long>, org.springframework.data.repository.ListCrudRepository<Waveform,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<Waveform,Long>, org.springframework.data.repository.PagingAndSortingRepository<Waveform,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Waveform>, org.springframework.data.repository.Repository<Waveform,Long>

@Transactional public interface WaveformRepository extends DetachableJpaRepository<Waveform,Long>
  • Method Details

    • findByUniqueFields

      @Query("select w from Waveform w where w.event.eventId = :eventId and w.stream.station.networkName = :networkName and w.stream.station.stationName = :stationName and w.lowFrequency = :lowFrequency and w.highFrequency = :highFrequency order by w.id desc") Waveform findByUniqueFields(@Param("eventId") String eventId, @Param("networkName") String networkName, @Param("stationName") String stationName, @Param("lowFrequency") Double lowFrequency, @Param("highFrequency") Double highFrequency)
    • findOneByAllFields

      @Query("select w from Waveform w where w.beginTime = :beginTime and w.endTime = :endTime and w.event = :event and w.stream = :stream and w.segmentType = :segmentType and w.segmentUnits = :segmentUnits and w.lowFrequency = :lowFrequency and w.highFrequency = :highFrequency order by w.id desc") Waveform findOneByAllFields(@Param("beginTime") Date beginTime, @Param("endTime") Date endTime, @Param("event") Event event, @Param("stream") Stream stream, @Param("segmentType") String segmentType, @Param("segmentUnits") String segmentUnits, @Param("lowFrequency") Double lowFrequency, @Param("highFrequency") Double highFrequency)
    • getWaveformMetadata

      @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.maxVelTime, w.codaStartTime, w.userStartTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w order by w.id desc") Set<Waveform> getWaveformMetadata()
    • getWaveformMetadataByActive

      @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.maxVelTime, w.codaStartTime, w.userStartTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w where w.active = :active order by w.id desc") List<Waveform> getWaveformMetadataByActive(@Param("active") boolean active)
    • findAllMetadataByIds

      @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.maxVelTime, w.codaStartTime, w.userStartTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w where w.id in :ids order by w.id desc") List<Waveform> findAllMetadataByIds(@Param("ids") List<Long> ids)
    • findWaveformMetadataById

      @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.maxVelTime, w.codaStartTime, w.userStartTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w where w.id = :id order by w.id desc") Waveform findWaveformMetadataById(@Param("id") Long id)
    • findPicksByWaveformId

      @Query("select p from WaveformPick p where p.waveform.id = :id") List<WaveformPick> findPicksByWaveformId(@Param("id") Long id)
    • findEventById

      @Query("select w.event from Waveform w where w.event.eventId = :eventId order by w.id desc") List<Event> findEventById(@Param("eventId") String eventId, org.springframework.data.domain.Pageable pageable)
    • setActiveByEventId

      @Modifying(clearAutomatically=true, flushAutomatically=true) @Query("update Waveform w SET w.active = :active where w.event.eventId = :eventId") int setActiveByEventId(@Param("eventId") String eventId, @Param("active") boolean active)
    • setActiveByStationName

      @Modifying(clearAutomatically=true, flushAutomatically=true) @Query("update Waveform w SET w.active = :active where w.stream.station.stationName = :stationName") int setActiveByStationName(@Param("stationName") String stationName, @Param("active") boolean active)
    • setActiveByStationNameAndEventId

      @Modifying(clearAutomatically=true, flushAutomatically=true) @Query("update Waveform w SET w.active = :active where w.stream.station.stationName = :stationName and w.event.eventId = :eventId") int setActiveByStationNameAndEventId(@Param("stationName") String stationName, @Param("eventId") String eventId, @Param("active") boolean active)
    • setAllActive

      @Modifying(clearAutomatically=true, flushAutomatically=true) @Query("update Waveform w SET w.active = :active") void setAllActive(boolean active)
    • setActiveIn

      @Modifying(clearAutomatically=true, flushAutomatically=true) @Query("update Waveform w SET w.active = :active where w.id in (:ids)") int setActiveIn(@Param("active") boolean active, @Param("ids") List<Long> waveformIds)
    • setActiveNotIn

      @Modifying(clearAutomatically=true, flushAutomatically=true) @Query("update Waveform w SET w.active = :active where w.id not in (:ids)") int setActiveNotIn(@Param("active") boolean active, @Param("ids") List<Long> waveformIds)
    • getMetadataInsideBounds

      @Query("select new Waveform(w.id, w.version, w.event, w.stream, w.beginTime, w.endTime, w.maxVelTime, w.codaStartTime, w.userStartTime, w.segmentType, w.segmentUnits, w.lowFrequency, w.highFrequency, w.sampleRate, w.active) from Waveform w where w.active = :active and(w.stream.station.latitude between :minX and :maxX and w.stream.station.longitude between :minY and :maxY) or (w.event.latitude between :minX and :maxX and w.event.longitude between :minY and :maxY)") List<Waveform> getMetadataInsideBounds(@Param("active") boolean active, @Param("minX") Double minX, @Param("minY") Double minY, @Param("maxX") Double maxX, @Param("maxY") Double maxY)
    • findAllIdsByEventId

      @Query("select w.id from Waveform w where w.event.eventId = :eventId") List<Long> findAllIdsByEventId(@Param("eventId") String eventId)
    • findAllIdsByStationName

      @Query("select w.id from Waveform w where w.stream.station.stationName = :stationName") List<Long> findAllIdsByStationName(@Param("stationName") String stationName)
    • findAllIdsByStationNameAndEventId

      @Query("select w.id from Waveform w where w.stream.station.stationName = :stationName and w.event.eventId = :eventId") List<Long> findAllIdsByStationNameAndEventId(@Param("stationName") String stationName, @Param("eventId") String eventId)
    • findAllActiveStacksByStationNames

      @Query("select w from Waveform w where w.active = true and w.stream.channelName = \'STACK\' and w.stream.station.stationName in :stationNames") List<Waveform> findAllActiveStacksByStationNames(@Param("stationNames") List<String> stationNames)
    • findAllActiveStacksByEventIdAndStationNames

      @Query("select w from Waveform w where w.active = true and w.event.eventId = :eventId and w.stream.channelName = \'STACK\' and w.stream.station.stationName in :stationNames") List<Waveform> findAllActiveStacksByEventIdAndStationNames(@Param("eventId") String eventId, @Param("stationNames") List<String> stationNames)
    • findAllInactiveIds

      @Query("select w.id from Waveform w where w.active = false") List<Long> findAllInactiveIds()
    • findIdsNotIn

      @Query("select w.id from Waveform w where w.id not in (:ids)") List<Long> findIdsNotIn(@Param("ids") List<Long> ids)
    • findAllActiveSharedEventStationStacksById

      @Query("select w from Waveform w where w.active = true and w.stream.channelName = \'STACK\' and w.event.eventId in (select ev.event.eventId from Waveform ev where ev.id = :id) and w.stream.station.stationName in (select sta.stream.station.stationName from Waveform sta where sta.id = :id)") List<Waveform> findAllActiveSharedEventStationStacksById(@Param("id") Long id)
    • findAllSharedEventStationStacksById

      @Query("select w from Waveform w where w.stream.channelName = \'STACK\' and w.event.eventId in (select ev.event.eventId from Waveform ev where ev.id = :id) and w.stream.station.stationName in (select sta.stream.station.stationName from Waveform sta where sta.id = :id)") List<Waveform> findAllSharedEventStationStacksById(@Param("id") Long id)
    • getUniqueEventIds

      @Query("select distinct w.event.eventId from Waveform w") List<String> getUniqueEventIds()