-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #385 from cardano-foundation/feat/MET-2055-update-…
…votes-section-dev-test Feat/met 2055 update votes section dev test
- Loading branch information
Showing
2 changed files
with
52 additions
and
5 deletions.
There are no files selected for viewing
12 changes: 12 additions & 0 deletions
12
src/main/java/org/cardanofoundation/job/repository/ledgersync/StakeAddressRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,23 @@ | ||
package org.cardanofoundation.job.repository.ledgersync; | ||
|
||
import java.util.List; | ||
import java.util.Set; | ||
|
||
import org.springframework.data.jpa.repository.JpaRepository; | ||
import org.springframework.data.jpa.repository.Query; | ||
import org.springframework.data.repository.query.Param; | ||
|
||
import org.cardanofoundation.explorer.common.entity.ledgersync.StakeAddress; | ||
|
||
public interface StakeAddressRepository extends JpaRepository<StakeAddress, Long> { | ||
|
||
StakeAddress findByView(@Param("aLong") String aLong); | ||
|
||
@Query( | ||
value = | ||
""" | ||
select sa from StakeAddress sa | ||
where sa.view in :addresses and not exists (select true from StakeAddress sa2 where sa2.view = sa.view and sa2.id > sa.id) | ||
""") | ||
List<StakeAddress> findStakeAddressesByViewIn(@Param("addresses") Set<String> addresses); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters