Interface OrderItemRepository

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

@Repository public interface OrderItemRepository extends org.springframework.data.jpa.repository.JpaRepository<OrderItem,Long>
Repositorio JPA para la entidad OrderItem.
  • Method Summary

    Modifier and Type
    Method
    Description
    Busca todos los items de un pedido.
    findByProductId(Long productId)
    Busca todos los items que contienen un producto especĂ­fico.

    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

    • findByOrderId

      List<OrderItem> findByOrderId(Long orderId)
      Busca todos los items de un pedido.
      Parameters:
      orderId - ID del pedido
      Returns:
      lista de items del pedido
    • findByProductId

      List<OrderItem> findByProductId(Long productId)
      Busca todos los items que contienen un producto especĂ­fico.
      Parameters:
      productId - ID del producto
      Returns:
      lista de items que contienen ese producto