Interface TripRepository

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

@Repository public interface TripRepository extends org.springframework.data.jpa.repository.JpaRepository<Trip,Long>
  • Method Summary

    Modifier and Type
    Method
    Description
    Obtiene todos los viajes donde el usuario es miembro.
    Busca un viaje por su código único (para invitaciones).

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

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

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

    deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlush

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

    findAll, findAllById, saveAll

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

    findAll

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

    findAll

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

    count, exists, findAll, findBy, findOne
  • Method Details

    • findByTripCode

      Optional<Trip> findByTripCode(String tripCode)
      Busca un viaje por su código único (para invitaciones).
    • findAllByUserId

      @Query("SELECT t FROM Trip t JOIN t.members m WHERE m.user.id = :userId") List<Trip> findAllByUserId(@Param("userId") Long userId)
      Obtiene todos los viajes donde el usuario es miembro.