Interface ExchangeRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<Exchange,​java.lang.Long>, org.springframework.data.jpa.repository.JpaRepository<Exchange,​java.lang.Long>, org.springframework.data.repository.PagingAndSortingRepository<Exchange,​java.lang.Long>, org.springframework.data.repository.query.QueryByExampleExecutor<Exchange>, org.springframework.data.repository.Repository<Exchange,​java.lang.Long>

@Repository
public interface ExchangeRepository
extends org.springframework.data.jpa.repository.JpaRepository<Exchange,​java.lang.Long>
  • Method Summary

    Modifier and Type Method Description
    java.util.Optional<Exchange> checkForExchange​(Assignment assignment, Groups group)  
    java.util.List<Exchange> getByUserId​(java.lang.Long id)  
    java.util.List<java.lang.Object[]> getMatches()  

    Methods inherited from interface org.springframework.data.repository.CrudRepository

    count, delete, deleteAll, deleteAll, deleteById, existsById, findById, save

    Methods inherited from interface org.springframework.data.jpa.repository.JpaRepository

    deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAllById, flush, getOne, saveAll, saveAndFlush

    Methods inherited from interface org.springframework.data.repository.PagingAndSortingRepository

    findAll

    Methods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor

    count, exists, findAll, findOne
  • Method Details

    • checkForExchange

      @Query("FROM Exchange WHERE owned_id = ?1 AND desired_id = ?2") java.util.Optional<Exchange> checkForExchange​(@Param("owned_id") Assignment assignment, @Param("desired_id") Groups group)
    • getByUserId

      @Query("FROM Exchange WHERE ownerId = ?1") java.util.List<Exchange> getByUserId​(@Param("id") java.lang.Long id)
    • getMatches

      @Query("Select e1,e2 FROM Exchange e1, Exchange e2 WHERE e1.ownedAssignment.group.id = e2.desiredAssignment.id") java.util.List<java.lang.Object[]> getMatches()