Package com.proyecto.jpa.repository
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 TypeMethodDescriptionfindByOrderId(Long orderId) 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, saveMethods inherited from interface org.springframework.data.jpa.repository.JpaRepository
deleteAllByIdInBatch, deleteAllInBatch, deleteAllInBatch, deleteInBatch, findAll, findAll, flush, getById, getOne, getReferenceById, saveAllAndFlush, saveAndFlushMethods inherited from interface org.springframework.data.repository.ListCrudRepository
findAll, findAllById, saveAllMethods inherited from interface org.springframework.data.repository.ListPagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.PagingAndSortingRepository
findAllMethods inherited from interface org.springframework.data.repository.query.QueryByExampleExecutor
count, exists, findAll, findBy, findOne
-
Method Details
-
findByOrderId
Busca todos los items de un pedido.- Parameters:
orderId- ID del pedido- Returns:
- lista de items del pedido
-
findByProductId
Busca todos los items que contienen un producto especĂfico.- Parameters:
productId- ID del producto- Returns:
- lista de items que contienen ese producto
-