Interface CommisionRepository

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

@Repository
public interface CommisionRepository
extends org.springframework.data.jpa.repository.JpaRepository<Commision,​java.lang.Long>
CommisionRepository.getUsers: Return list of: SELECT * FROM Commision WHERE owner_id = i . Where i, ?1 are equale to variables. CommisionRepository.getNewestCommision Return list of: SELECT * FROM Commision WHERE owner_id = i Order by commisionDate desc. Where i, ?1 are equale to variables.
  • Method Summary

    Modifier and Type Method Description
    java.util.List<Commision> getNewestCommision​(java.lang.Long id)  
    java.util.List<Commision> getUsers​(java.lang.Long id)  
    java.lang.Object[] getUsersAssigned()  

    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

    • getUsers

      @Query("FROM Commision WHERE owner_id = ?1") java.util.List<Commision> getUsers​(@Param("owner_id") java.lang.Long id)
    • getNewestCommision

      @Query("FROM Commision WHERE owner_id = ?1 order by commisionDate desc") java.util.List<Commision> getNewestCommision​(@Param("owner_id") java.lang.Long id)
    • getUsersAssigned

      @Query("SELECT COUNT(DISTINCT owner_id) AS count FROM Commision") java.lang.Object[] getUsersAssigned()
      Returns:
      ammount of uniqe users that have a commision placed on first array element